OSDN Git Service
Dylan McKay [Fri, 20 May 2016 23:39:04 +0000 (23:39 +0000)]
[AVR] Fix signuature of AVRTargetMachine constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270292
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 20 May 2016 23:14:56 +0000 (23:14 +0000)]
LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()
We now use LiveRangeCalc::extendToUses() instead of a specially designed
algorithm in constructMainRangeFromSubranges():
- The original motivation for constructMainRangeFromSubranges() were
differences between the main liverange and subranges because of hidden
dead definitions. This case however cannot happen anymore with the
DetectDeadLaneMasks pass in place.
- It simplifies the code.
- This fixes a longstanding bug where we did not properly create new SSA
values on merging control flow (the MachineVerifier missed most of
these cases).
- Move constructMainRangeFromSubranges() to LiveIntervalAnalysis and
LiveRangeCalc to better match the implementation/available helper
functions.
This re-applies r269016. The fixes from r270290 and r270259 should avoid
the machine verifier problems this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270291
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 20 May 2016 23:02:13 +0000 (23:02 +0000)]
MachineVerifier: subregs so not require defs/valnos on every path
It is fine for subregister ranges to be undefined on some CFG paths as
we may have a "vregX:other_subreg<read-undef> =" def on that path. We
do not (and should not) have live segments for the subregister ranges.
The MachineVerifier should not complain about this.
This is a slight variant of http://llvm.org/PR27705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270290
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Fri, 20 May 2016 22:59:05 +0000 (22:59 +0000)]
Fix struct member names and simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270289
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Shen [Fri, 20 May 2016 22:42:01 +0000 (22:42 +0000)]
[PowerPC] Add a testcase for TCO on string rvo function
Differential Revision: http://reviews.llvm.org/D20311
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270287
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 20 May 2016 22:31:50 +0000 (22:31 +0000)]
[yaml2obj] [MachO] Fill Segment and Section data
This fills section data with 0xDEADBEEF and segment data not inside a section with 0xBAADDA7A. This results in yaml2obj generating a matching size object file. Any additional bytes in the file are zero'd.
This is a starting point for populating the remaining segment data, and provides a hex viewable file that you can easily see the missing data in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270286
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 22:08:40 +0000 (22:08 +0000)]
add test vector sdiv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270285
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 22:08:16 +0000 (22:08 +0000)]
add test for vector shift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270284
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 20 May 2016 21:43:23 +0000 (21:43 +0000)]
SDAG: Implement Select instead of SelectImpl in PPCDAGToDAGISel
- Where we were returning a node before, call ReplaceNode instead.
- Where we would return null to fall back to another selector, rename
the method to try* and return a bool for success.
- Where we were calling SelectNodeTo, just return afterwards.
Part of llvm.org/pr26808.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270283
91177308-0d34-0410-b5e6-
96231b3b80d8
Jacques Pienaar [Fri, 20 May 2016 21:41:53 +0000 (21:41 +0000)]
[lanai] Change reloc to use PIC_ by default and cleanup.
* Change reloc to PIC_;
* Cleanup (clang-format & modify test);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270282
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 May 2016 21:38:15 +0000 (21:38 +0000)]
Switch from the linux-specific 'struct sigaltstack' to POSIX's 'stack_t'. This
is what I get for trusting my system's man pages I suppose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270280
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 May 2016 21:26:00 +0000 (21:26 +0000)]
Add a configure-time check for the existence of sigaltstack. It seems that some
systems provide a <signal.h> that doesn't declare it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270278
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 May 2016 21:18:12 +0000 (21:18 +0000)]
Reinstate r269992 (reverting r270267), but restricted to cases where glibc is
the C standard library implementation in use.
This works around a glibc bug in the backtrace() function where it fails to
produce a backtrace on x86_64 if libgcc / libunwind is statically linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270276
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 May 2016 21:07:41 +0000 (21:07 +0000)]
Create a sigaltstack when we register our signal handlers. Otherwise we'd very
likely fail to produce a backtrace if we crash due to stack overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270273
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 20 May 2016 20:55:51 +0000 (20:55 +0000)]
Revert r270268 due to unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270272
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 20:55:17 +0000 (20:55 +0000)]
add tests for vector urem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270271
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 20 May 2016 20:41:24 +0000 (20:41 +0000)]
Address post-review for r270246
This gets rid of some unnecessary SmallStrings in
X86TargetMachine::getSubtargetImpl.
No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270270
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 20 May 2016 20:36:06 +0000 (20:36 +0000)]
dsymutil/modules: Reword the warning for static libraries without module caches
In addition to clarifying the warning message this contains a minor functional
change in that it now warns if the *immediate* parent directory in which the
missing PCM is expected to be isn't found.
This patch also includes a more comprehensive testcase.
rdar://problem/
25860711
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270269
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 20 May 2016 20:26:50 +0000 (20:26 +0000)]
[BasicAA] Turn DecomposeGEPExpression runtime checks into asserts.
When it has a DataLayout, DecomposeGEPExpression() should return the same object
as GetUnderlyingObject(). Per the FIXME, it currently always has a DL, so the
runtime check is redundant and can become an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270268
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 20 May 2016 20:15:17 +0000 (20:15 +0000)]
Revert "Work around a glibc bug: backtrace() spuriously fails if..."
This commit has been breaking the FreeBSD bots:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd
This reverts commit r269992.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270267
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 20:07:18 +0000 (20:07 +0000)]
use FileCheck instead of grep for exact checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270265
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Bruening [Fri, 20 May 2016 20:00:05 +0000 (20:00 +0000)]
[esan] Use ModulePass for EfficiencySanitizerPass.
Summary:
Uses ModulePass instead of FunctionPass for EfficiencySanitizerPass to
better support global variable creation for a forthcoming struct field
counter tool.
Patch by Qin Zhao.
Reviewers: aizatsky
Subscribers: llvm-commits, eugenis, vitalybuka, bruening, kcc
Differential Revision: http://reviews.llvm.org/D20458
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270263
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Fri, 20 May 2016 19:55:17 +0000 (19:55 +0000)]
pdbdump: print out symbol names referred by publics stream.
DBI stream contains a stream number of the symbol record stream.
Symbol record streams is an array of length-type-value members.
Each member represents one symbol.
Publics stream contains offsets to the symbol record stream.
This patch is to print out all symbols that are referenced by
the publics stream.
Note that even with this patch, llvm-pdbdump cannot dump all the
information in a publics stream since it contains more information
than symbol names. I'll improve it in followup patches.
Differential Revision: http://reviews.llvm.org/D20480
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270262
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 20 May 2016 19:46:42 +0000 (19:46 +0000)]
Use report_fatal_error after all
Depending on the compiler used to build LLVM, llvm_unreachable can either
expand to a call to abort(), or to a __builtin_unreachable. The latter
does not have a predictable behavior at runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270260
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 20 May 2016 19:46:13 +0000 (19:46 +0000)]
LiveIntervalAnalysis: Fix missing defs in renameDisconnectedComponents().
Fix renameDisconnectedComponents() creating vreg uses that can be
reached from function begin withouthaving a definition (or explicit
live-in). Fix this by inserting IMPLICIT_DEF instruction before
control-flow joins as necessary.
Removes an assert from MachineScheduler because we may now get
additional IMPLICIT_DEF when preparing the scheduling policy.
This fixes the underlying problem of http://llvm.org/PR27705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270259
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 20 May 2016 19:35:35 +0000 (19:35 +0000)]
CodeGen: Move the call to DwarfDebug::beginModule() out of the constructor.
This gives AsmPrinter a chance to initialize its DD field before
we call beginModule(), which is about to start using it.
Differential Revision: http://reviews.llvm.org/D20413
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270258
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 20 May 2016 19:35:17 +0000 (19:35 +0000)]
CodeGen: Do not require a MachineFunction just to create a DIEDwarfExpression.
We are about to start using DIEDwarfExpression to create global variable
DIEs, which happens before we generate code for functions.
Differential Revision: http://reviews.llvm.org/D20412
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270257
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 20 May 2016 19:14:04 +0000 (19:14 +0000)]
CODE_OWNERS: Take ownership of SelectionDAG
Owen no longer has time to tend to the yaks in SelectionDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270253
91177308-0d34-0410-b5e6-
96231b3b80d8
Jun Bum Lim [Fri, 20 May 2016 18:45:49 +0000 (18:45 +0000)]
[AArch64] Disable narrow load merge by default
Summary:
As this optimization converts two loads into one load with two shift instructions,
it could potentially hurt performance if a loop is arithmetic operation intensive.
Reviewers: t.p.northover, mcrosier, jmolloy
Subscribers: evandro, jmolloy, aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D20172
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270251
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Lacey [Fri, 20 May 2016 18:39:11 +0000 (18:39 +0000)]
Functions with differing phis should not be merged.
Check that the incoming blocks of phi nodes are identical, and block
function merging if they are not.
rdar://problem/
26255167
Differential Revision: http://reviews.llvm.org/D20462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270250
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 18:37:33 +0000 (18:37 +0000)]
[RegBankSelect] Look for the best mapping in greedy mode.
The Fast mode takes the first mapping, the greedy mode loops over all
the possible mapping for an instruction and choose the cheaper one.
Test case will come with target specific code, since we currently do not
have instructions that have several mappings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270249
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 20 May 2016 18:36:52 +0000 (18:36 +0000)]
[MachOYAML] Removing duplicated field from LC_UUID YAML
The uuid_command was duplicating the load_command.cmdsize field. This removes the duplicate from the YAML mapping and from the test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270248
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 18:17:16 +0000 (18:17 +0000)]
[RegBankSelect] Get rid of a now dead method: setSafeInsertPoint.
This is now encapsulated in the RepairingPlacement class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270247
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 20 May 2016 18:16:06 +0000 (18:16 +0000)]
[X86] Reduce memory allocations in X86TargetMachine::getSubtargetImpl
We performed a number of memory allocations each time getTTI was called,
remove them by using SmallString.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270246
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 18:00:46 +0000 (18:00 +0000)]
[RegBankSelect] Take advantage of a potential best cost information in
computeMapping.
Computing the cost of a mapping takes some time.
Since in Fast mode, the cost is irrelevant, just spare some cycles by not
computing it.
In Greedy mode, we need to choose the best cost, that means that when
the local cost gets more expensive than the best cost, we can stop
computing the repairing and cost for the current mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270245
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 17:54:09 +0000 (17:54 +0000)]
[RegBankSelect] Use frequency and probability information to compute
more precise cost in Greedy mode.
In Fast mode the cost is irrelevant so do not bother requiring that
those passes get scheduled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270244
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 17:36:54 +0000 (17:36 +0000)]
[RegBankSelect] Use the Fast mode for functions with the optnone attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270242
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 20 May 2016 17:20:42 +0000 (17:20 +0000)]
[obj2yaml][yaml2obj] Adding enumFallback for MachO load commands
This adds support for handling unknown load commands, and a bogus_load_command tests.
Unknown or unsupported load commands can be specified in YAML by their hex value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270239
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 17:07:19 +0000 (17:07 +0000)]
fix comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270237
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 17:00:10 +0000 (17:00 +0000)]
use range-loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270236
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 16:55:35 +0000 (16:55 +0000)]
[RegBankSelect] Specify different optimization mode for the pass.
The mode should be choose by the target when instantiating the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270235
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 16:46:01 +0000 (16:46 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270234
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 20 May 2016 16:38:34 +0000 (16:38 +0000)]
Fix error reporting in register scavenger (lack of emergency spill slot)
- Do not store Twine objects.
- Remove report_fatal_error, since llvm_unreachable does terminate the
program in release mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270233
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 16:36:12 +0000 (16:36 +0000)]
[RegBankSelect] Add a method to avoid splitting while repairing.
The previous choice of the insertion points for repairing was
straightfoward but may introduce some basic block or edge splitting. In
some situation this is something we can avoid.
For instance, when repairing a phi argument, instead of placing the
repairing on the related incoming edge, we may move it to the previous
block, before the terminators. This is only possible when the argument
is not defined by one of the terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270232
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 20 May 2016 16:23:14 +0000 (16:23 +0000)]
[PM/PartiallyInlineLibCalls] Fix pass dependencies.
Inline getAnalysisUsage() while I'm here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270231
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 20 May 2016 16:19:30 +0000 (16:19 +0000)]
[X86][AVX] Generalized matching for target shuffle combines
This patch is a first step towards a more extendible method of matching combined target shuffle masks.
Initially this just pulls out the existing basic mask matches and adds support for some 256/512 bit equivalents. Future patterns will require a number of features to be added but I wanted to keep this patch simple.
I hope we can avoid duplication between shuffle lowering and combining and share more complex pattern match functions in future commits.
Differential Revision: http://reviews.llvm.org/D19198
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270230
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 20 May 2016 16:05:55 +0000 (16:05 +0000)]
[X86][AVX] Sync with clang/test/CodeGen/avx-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270229
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 20 May 2016 15:52:23 +0000 (15:52 +0000)]
[PartiallyInlineLibCalls] Remove dead includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270228
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 20 May 2016 15:43:39 +0000 (15:43 +0000)]
[PM/PartiallyInlineLibCalls] Convert to static function in preparation for porting this pass to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270225
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 14:53:09 +0000 (14:53 +0000)]
[SimplifyCFG] eliminate switch cases based on known range of switch condition
This was noted in PR24766:
https://llvm.org/bugs/show_bug.cgi?id=24766#c2
We may not know whether the sign bit(s) are zero or one, but we can still
optimize based on knowing that the sign bit is repeated.
Differential Revision: http://reviews.llvm.org/D20275
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270222
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 20 May 2016 14:34:03 +0000 (14:34 +0000)]
Correction to r270219: fix detection of invalid frame index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270220
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 20 May 2016 14:18:54 +0000 (14:18 +0000)]
Skip entries with invalid indexes in the search loop in register scavenger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270219
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 May 2016 14:09:41 +0000 (14:09 +0000)]
[MCExpr] avoid UB via negation of INT_MIN
I accidentally exposed a bug in MCExpr::evaluateAsRelocatableImpl() with the test file added in:
http://reviews.llvm.org/rL269977
Differential Revision: http://reviews.llvm.org/D20434
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270218
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 20 May 2016 14:01:34 +0000 (14:01 +0000)]
[Hexagon] Use pipe instead of temporary files in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270217
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 May 2016 12:20:10 +0000 (12:20 +0000)]
Refactor X86 symbol access classification.
This refactors the logic in X86 to avoid code duplication. It also
splits it in two steps: it first decides if a symbol is local to the DSO
and then uses that information to decide how to access it.
The first part is implemented by shouldAssumeDSOLocal. It is not in any
way specific to X86. In a followup patch I intend to move it to
somewhere common and reused it in other backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270209
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 May 2016 12:00:52 +0000 (12:00 +0000)]
Simplify handling of hidden stubs on PowerPC.
We now handle them just like non hidden ones. This was already the case
on x86 (r207518) and arm (r207517).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270205
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 20 May 2016 10:53:56 +0000 (10:53 +0000)]
SparcISelLowering.cpp: Add missing StringSwitch.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270200
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Dewhurst [Fri, 20 May 2016 10:21:01 +0000 (10:21 +0000)]
[Sparc] Implement getRegisterByName.
Allows Sparc registers to be specifically referred to in inline assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270198
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 20 May 2016 09:18:37 +0000 (09:18 +0000)]
[ProfileData] Thread unique_ptr through the summary builder to avoid leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270195
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Kudrin [Fri, 20 May 2016 09:14:24 +0000 (09:14 +0000)]
[Coverage] Fix an issue where improper coverage mapping data could be loaded for an inline function.
If an inline function is observed but unused in a translation unit, dummy
coverage mapping data with zero hash is stored for this function.
If such a coverage mapping section came earlier than real one, the latter
was ignored. As a result, llvm-cov was unable to show coverage information
for those functions.
Differential Revision: http://reviews.llvm.org/D20286
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270194
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Dewhurst [Fri, 20 May 2016 09:03:01 +0000 (09:03 +0000)]
[Sparc] Enable more inline assembly constraints.
Note: This is specifically to allow GCC's test pr44707 to pass.
Trivial change, not put for differential revision. Test included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270192
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 20 May 2016 08:06:31 +0000 (08:06 +0000)]
Fix some comment typos in SelectionDAGBuilder. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270190
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 20 May 2016 05:13:35 +0000 (05:13 +0000)]
Target: move enum back into MC
Move the enumeration back to avoid the layering violation. Should repair the
modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270184
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 20 May 2016 05:10:32 +0000 (05:10 +0000)]
[X86] Run the AVX/AVX2 intrinsic tests in AVX512VL mode too just to make sure we don't break any older intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270183
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 20 May 2016 05:10:27 +0000 (05:10 +0000)]
[X86] Fix another AVX pattern to only be disable if VLX and BWI are supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270182
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 20 May 2016 03:39:28 +0000 (03:39 +0000)]
Target: move the EH enumeration and add option
Move the ExceptionHandling enumeration into TargetOptions and introduce a field
to track the desired exception model. This will allow us to set the exception
model from the frontend (needed to optionally use SjLj EH on other targets where
zero-cost is available and preferred).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270178
91177308-0d34-0410-b5e6-
96231b3b80d8
Jacques Pienaar [Fri, 20 May 2016 03:21:37 +0000 (03:21 +0000)]
[lanai] Use Optional<Reloc> in LanaiTargetMachine.
Follow r269988 and use Optional<Reloc>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270176
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 20 May 2016 02:01:51 +0000 (02:01 +0000)]
Revert accidental commit of a test command line addition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270175
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 20 May 2016 02:00:08 +0000 (02:00 +0000)]
[X86] Fix some AVX patterns to only be disabled if VLX and BWI are supported. Without this we get isel failures on the avx-intrinsics-x86.ll test in AVX512VL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270174
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Liew [Fri, 20 May 2016 01:37:54 +0000 (01:37 +0000)]
[LibFuzzer] Fix implementation of ``GetPeakRSSMb()`` on Mac OSX.
On Linux ``rusage.ru_maxrss`` is in KiB but on Mac OSX it is in bytes.
Differential Revision: http://reviews.llvm.org/D20410
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270173
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Liew [Fri, 20 May 2016 01:30:36 +0000 (01:30 +0000)]
[LibFuzzer] Fix ``NumberOfCpuCores()`` on Mac OSX.
The ``nprocs`` command does not exist under Mac OSX so use
``sysctl`` instead on that platform.
Whilst I'm here
* Use ``pclose()`` instead of ``fclose()`` which the ``popen()``
documentation says should be used.
* Check for errors that were previously unhandled.
Differential Revision: http://reviews.llvm.org/D20409
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270172
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Fri, 20 May 2016 01:17:38 +0000 (01:17 +0000)]
Add AVRTargetStreamers
Reviewed by Matt Arsenault in http://reviews.llvm.org/D16311
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270171
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 00:55:51 +0000 (00:55 +0000)]
[RegBankSelect] Refactor the code to split the repairing and mapping of
an instruction.
Use the previously introduced RepairingPlacement class to split the code
computing the repairing placement from the code doing the actual
placement. That way, we will be able to consider different placement and
then, only apply the best one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270168
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 00:49:10 +0000 (00:49 +0000)]
[RegBankSelect] Add helper class for repairing code placement.
When assigning the register banks we may have to insert repairing code
to move already assigned values accross register banks.
Introduce a few helper classes to keep track of what is involved in the
repairing of an operand:
- InsertPoint and its derived classes record the positions, in the CFG,
where repairing has to be inserted.
- RepairingPlacement holds all the insert points for the repairing of an
operand plus the kind of action that is required to do the repairing.
This is going to be used to keep track of how the repairing should be
done, while comparing different solutions for an instruction. Indeed, we
will need the repairing placement to capture the cost of a solution and
we do not want to compute it a second time when we do the actual
repairing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270167
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 00:42:57 +0000 (00:42 +0000)]
[RegBankSelect] Refactor assignmentMatch to avoid testing the current
register bank twice.
Prior to this change, we were checking if the assignment for the current
machine operand was matching, then we would check if the mismatch
requires to insert repair code.
We actually already have this information from the first check, so just
pass it along.
NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270166
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 May 2016 00:38:28 +0000 (00:38 +0000)]
Fix pr27728.
Sorry for the lack testcase. There is one in the pr, but it depends on
std::sort and the .ll version is 110 lines, so I don't think it is
wort it.
The bug was that we were sorting after adding a terminator, and the
sorting algorithm could end up putting the terminator in the middle of
the List vector.
With that we would create a Spans map entry keyed on nullptr which would
then be added to CUs and fail in that sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270165
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 20 May 2016 00:35:26 +0000 (00:35 +0000)]
[RegBankSelect] Introduce MappingCost helper class.
This helper class will be used to represent the cost of mapping an
instruction to a specific register bank.
The particularity of these costs is that they are mostly local, thus the
frequency of the basic block is irrelevant. However, for few
instructions (e.g., phis and terminators), the cost may be non-local and
then, we need to account for the frequency of the involved basic blocks.
This will be used by the greedy mode I am working on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270163
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 May 2016 00:05:55 +0000 (00:05 +0000)]
Restore ASCIIbetical order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270161
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 19 May 2016 23:26:39 +0000 (23:26 +0000)]
[obj2yaml] [yaml2obj] Adding a test for r270124
This test covers strings after load command structs and zero fill bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270159
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 19 May 2016 23:26:31 +0000 (23:26 +0000)]
[yaml2obj] Removing debug code that scribbled 0xDEADBEEF
Now that MachO load command fields are fully covered we can fill unaccounted for bytes with 0. That allows us to sparsely specify YAML to simplify tests.
Simplifying load_commands test accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270158
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 19 May 2016 23:26:05 +0000 (23:26 +0000)]
[RuntimeDyld][MachO] Add support for SUBTRACTOR relocations between anonymous
symbols on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270157
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 May 2016 23:17:37 +0000 (23:17 +0000)]
clang-format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270156
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 19 May 2016 23:15:59 +0000 (23:15 +0000)]
Add const qualifiers to appease bots; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270155
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Thu, 19 May 2016 23:02:09 +0000 (23:02 +0000)]
Allow -inline-threshold to override default threshold.
Before r257832, the threshold used by SimpleInliner was explicitly specified or generated from opt levels and passed to the base class Inliner's constructor. There, it was first overridden by explicitly specified -inline-threshold. The refactoring in r257832 did not preserve this behavior for all opt levels. This change brings back the original behavior.
Differential Revision: http://reviews.llvm.org/D20452
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270153
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 19 May 2016 22:56:37 +0000 (22:56 +0000)]
Forgotten file from r269992.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270152
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 19 May 2016 22:55:46 +0000 (22:55 +0000)]
[GuardWidening] Introduce range check merging
Sequences of range checks expressed using guards, like
guard((I - 2) u< L)
guard((I - 1) u< L)
guard((I + 0) u< L)
guard((I + 1) u< L)
guard((I + 2) u< L)
can sometimes be combined into a smaller sequence:
guard((I - 2) u< L AND (I + 2) u< L)
if we can prove that (I - 2) u< L AND (I + 2) u< L implies all of checks
expressed in the previous sequence.
This change teaches GuardWidening to do this kind of merging when
feasible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270151
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 19 May 2016 22:40:37 +0000 (22:40 +0000)]
Reapply r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.
Using Chandler's words from r265331:
This commit was greatly exacerbating PR17409 and effectively regressed
build time for lot of (very large) code when compiled with ASan or MSan.
PR17409 is fixed by r269249, so this is fine to reapply r263460.
Original commit message:
The bad behavior happens when we have a function with a long linear
chain of basic blocks, and have a live range spanning most of this
chain, but with very few uses.
Let say we have only 2 uses.
The Hopfield network is only seeded with two active blocks where the
uses are, and each iteration of the outer loop in
`RAGreedy::growRegion()` only adds two new nodes to the network due to
the completely linear shape of the CFG. Meanwhile,
`SpillPlacer->iterate()` visits the whole set of discovered nodes, which
adds up to a quadratic algorithm.
This is an historical accident effect from r129188.
When the Hopfield network is expanding, most of the action is happening
on the frontier where new nodes are being added. The internal nodes in
the network are not likely to be flip-flopping much, or they will at
least settle down very quickly. This means that while
`SpillPlacer->iterate()` is recomputing all the nodes in the network, it
is probably only the two frontier nodes that are changing their output.
Instead of recomputing the whole network on each iteration, we can
maintain a SparseSet of nodes that need to be updated:
- `SpillPlacement::activate()` adds the node to the todo list.
- When a node changes value (i.e., `update()` returns true), its
neighbors are added to the todo list.
- `SpillPlacement::iterate()` only updates the nodes in the list.
The result of Hopfield iterations is not necessarily exact. It should
converge to a local minimum, but there is no guarantee that it will find
a global minimum. It is possible that updating nodes in a different
order will cause us to switch to a different local minimum. In other
words, this is not NFC, but although I saw a few runtime improvements
and regressions when I benchmarked this change, those were side effects
and actually the performance change is in the noise as expected.
Huge thanks to Jakob Stoklund Olesen <stoklund@2pi.dk> for his
feedbacks, guidance and time for the review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270149
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 May 2016 22:07:57 +0000 (22:07 +0000)]
Record a TargetMachine instead of a Reloc::Model.
Addresses r270095's code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270147
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Liew [Thu, 19 May 2016 22:00:33 +0000 (22:00 +0000)]
[LibFuzzer]
Work around crashes in ``__sanitizer_malloc_hook()`` under Mac OSX.
Under Mac OSX we intercept calls to malloc before thread local
storage is initialised leading to a crash when accessing
``AllocTracer``. To workaround this ``AllocTracer`` is only accessed
in the hook under Linux. For symmetry ``__sanitizer_free_hook()``
is also modified in the same way.
To support this change a set of new macros
LIBFUZZER_LINUX and LIBFUZZER_APPLE has been defined which can be
used to check the target being compiled for.
Differential Revision: http://reviews.llvm.org/D20402
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270145
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Thu, 19 May 2016 21:53:28 +0000 (21:53 +0000)]
Remove specializations of ProfileSummary
This removes the subclasses of ProfileSummary, moves the members of the derived classes to the base class.
Differential Revision: http://reviews.llvm.org/D20390
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270143
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Thu, 19 May 2016 21:39:00 +0000 (21:39 +0000)]
[ARM, AArch64] Match additional patterns to ldN instructions
When matching an interleaved load to an ldN pattern, the interleaved access
pass checks that all users of the load are shuffles. If the load is used by an
instruction other than a shuffle, the pass gives up and an ldN is not
generated. This patch considers users of the load that are extractelement
instructions. It attempts to modify the extracts to use one of the available
shuffles rather than the load. After the transformation, the load is only used
by shuffles and will then be matched with an ldN pattern.
Differential Revision: http://reviews.llvm.org/D20250
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270142
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 19 May 2016 21:09:58 +0000 (21:09 +0000)]
AMDGPU: Remove pointless conversions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270139
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 19 May 2016 21:07:20 +0000 (21:07 +0000)]
[WebAssembly] Simplify code that never has to handle physical registers. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270137
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Thu, 19 May 2016 21:07:12 +0000 (21:07 +0000)]
Move ProfileSummary to IR.
This splits ProfileSummary into two classes: a ProfileSummary class that has methods to convert from/to metadata and a ProfileSummaryBuilder class that computes the profiles summary which is in ProfileData.
Differential Revision: http://reviews.llvm.org/D20314
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270136
91177308-0d34-0410-b5e6-
96231b3b80d8
Guozhi Wei [Thu, 19 May 2016 21:07:01 +0000 (21:07 +0000)]
[InstCombine] Avoid combining the bitcast of a var that is used as both address and result of load instructions
This patch fixes https://llvm.org/bugs/show_bug.cgi?id=27703.
If there is a sequence of one or more load instructions, each loaded value is used as address of later load instruction, bitcast is necessary to change the value type, don't optimize it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270135
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 19 May 2016 21:00:02 +0000 (21:00 +0000)]
comment out line that is causing UBSAN bot failures
Patch is awaiting review here:
http://reviews.llvm.org/D20434
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270128
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 19 May 2016 20:54:43 +0000 (20:54 +0000)]
[obj2yaml] [yaml2obj] Support for MachO Load Command data
This re-applies r270115.
Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.
The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.
The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.
The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270124
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 19 May 2016 20:48:54 +0000 (20:48 +0000)]
Revert "[obj2yaml] [yaml2obj] Support for MachO Load Command data"
This reverts commit r270115.
This failed on several builders using GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270121
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 May 2016 20:44:22 +0000 (20:44 +0000)]
Fix -Wunused-variable in non-Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270118
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 19 May 2016 20:40:03 +0000 (20:40 +0000)]
[obj2yaml] [yaml2obj] Support for MachO Load Command data
Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.
The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.
The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.
The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270115
91177308-0d34-0410-b5e6-
96231b3b80d8