Reid Kleckner [Wed, 14 Jan 2015 22:47:54 +0000 (22:47 +0000)]
Use MMI->getPersonality() instead of MMI->getPersonalities()[MMI->getPersonalityIndex()]
Also nuke the comment about supporting multiple personalities in a
single function, aka PR1414. That's just crazy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226052
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 22:27:36 +0000 (22:27 +0000)]
IR: Move MDLocation into place
This commit moves `MDLocation`, finishing off PR21433. There's an
accompanying clang commit for frontend testcases. I'll attach the
testcase upgrade script I used to PR21433 to help out-of-tree
frontends/backends.
This changes the schema for `DebugLoc` and `DILocation` from:
!{i32 3, i32 7, !7, !8}
to:
!MDLocation(line: 3, column: 7, scope: !7, inlinedAt: !8)
Note that empty fields (line/column: 0 and inlinedAt: null) don't get
printed by the assembly writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226048
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 14 Jan 2015 22:25:14 +0000 (22:25 +0000)]
MachineVerifier: Allow undef reads if a matching superreg is defined.
Summary:
Some pseudo instruction expansions break down a wide register use into
multiple uses of smaller sub registers. If the super register was
partially undefined the broken down sub registers may be completely
undefined now leading to MachineVerifier complaints. Unfortunately
liveness information to add the required dead flags is not easily
(cheaply) available when expanding pseudo instructions.
This commit changes the verifier to be quiet if there is an additional
implicit use of a super register. Pseudo instruction expanders can use
this to mark cases where partially defined values get potentially broken
into completely undefined ones.
Differential Revision: http://reviews.llvm.org/D6973
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226047
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 22:14:26 +0000 (22:14 +0000)]
IR: Always print MDLocation line
Print `MDLocation`'s `line` field even when it's 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226046
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 21:58:17 +0000 (21:58 +0000)]
IR: Drop metadata references more aggressively during teardown
Sometimes teardown happens before the debug info graph is complete
(e.g., when clang throws an error). In that case, `MDNode`s will still
have RAUW, so deleting constants that the `MDNode`s point at will be
relatively expensive -- it'll cause re-uniquing all up the chain (what
I've been referring to as "teardown madness").
So, drop references *before* deleting constants. We need to drop a few
more references now: the metadata side of the metadata/value bridges
needs to be dropped off the cliff along with the rest of it (previously,
the bridges were cleaned before we did anything with the `MDNode`s).
There's no real functionality change here -- state before and after
`LLVMContextImpl::~LLVMContextImpl()` is unchanged -- so no testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226044
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 20:55:48 +0000 (20:55 +0000)]
Don't create new comdats in CodeGen.
This patch stops the implicit creation of comdats during codegen.
Clang now sets the comdat explicitly when it is required. With this patch clang and gcc
now produce the same result in pr19848.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226038
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 14 Jan 2015 20:26:15 +0000 (20:26 +0000)]
[Hexagon] Removing old, unused !tstbit instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226036
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 20:24:46 +0000 (20:24 +0000)]
Add a test that would have found the issue with r225644.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226035
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 20:19:29 +0000 (20:19 +0000)]
[MBP] Add flags to disable the BadCFGConflict check in MachineBlockPlacement.
Some benchmarks have shown that this could lead to a potential
performance benefit, and so adding some flags to try to help measure the
difference.
A possible explanation. In diamond-shaped CFGs (A followed by either
B or C both followed by D), putting B and C both in between A and
D leads to the code being less dense than it could be. Always either
B or C have to be skipped increasing the chance of cache misses etc.
Moving either B or C to after D might be beneficial on average.
In the long run, but we should probably do a better job of analyzing the
basic block and branch probabilities to move the correct one of B or
C to after D. But even if we don't use this in the long run, it is
a good baseline for benchmarking.
Original patch authored by Daniel Jasper with test tweaks and a second
flag added by me.
Differential Revision: http://reviews.llvm.org/D6969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226034
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 14 Jan 2015 20:17:10 +0000 (20:17 +0000)]
[PPC64] Add support for the ICBT instruction on POWER8.
Patch by Kit Barton.
Support for the ICBT instruction is currently present, but limited to
embedded processors. This change adds a new FeatureICBT that can be used
to identify whether the ICBT instruction is available on a specific processor.
Two new tests are added:
* Positive test to ensure the icbt instruction is present when using
-mcpu=pwr8
* Negative test to ensure the icbt instruction is not generated when
using -mcpu=pwr7
Both test cases use the Prefetch opcode in LLVM. They are based on the
ppc64-prefetch.ll test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226033
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 20:08:46 +0000 (20:08 +0000)]
Fix linking of shared libraries.
In shared libraries the plugin can see non-weak declarations that are still
undefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226031
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 14 Jan 2015 19:59:18 +0000 (19:59 +0000)]
Add comment about a gotcha I ran across while touching this code.
I haven't looked closely at exactly why the side effect is required, but
this seems better than not mentioning it at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226030
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 19:56:10 +0000 (19:56 +0000)]
IR: Fix a use-after-free in RAUW
Happened pretty commonly during `LLVMContext` teardown when `clang -g`
hit an error. This fixes the use-after-free. Next I'll clean up
teardown so that it's not RAUW'ing when metadata-tracked values are
deleted (only really causes a problem if the graph is mid-construction
when teardown starts, but it's still unnecessary work).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226029
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 14 Jan 2015 19:55:27 +0000 (19:55 +0000)]
unique_ptrify the value in DominatorTreeBase::DomTreeNodes
(noticed the need for an explicit dtor in a recent commit & figured I'd
tidy that up)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226028
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 19:43:32 +0000 (19:43 +0000)]
Fix handling of extern_weak. This was broken by r225983.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226026
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 14 Jan 2015 19:26:56 +0000 (19:26 +0000)]
InstCombine: Don't take A-B<0 into A<B if A-B has other uses
This fixes PR22226.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226023
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 19:07:23 +0000 (19:07 +0000)]
Revert "Add r224985 back with two fixes."
This reverts commit r225644 while I debug a regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226022
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 14 Jan 2015 18:50:10 +0000 (18:50 +0000)]
Emit the Itanium LSDA for unknown EH personalities on Win64
This fixes lots of generic CodeGen tests that use __gcc_personality_v0.
This suggests that using ExceptionHandling::MSVC was a mistake, and we
should instead classify each function by personality function. This
would, for example, allow us to LTO a binary containing uses of SEH and
Itanium EH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226019
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 14 Jan 2015 18:49:39 +0000 (18:49 +0000)]
Remove dead code for llvm.eh.selector in the old EH model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226018
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 14 Jan 2015 18:26:14 +0000 (18:26 +0000)]
[Hexagon] Removing old versions of cmph and updating references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226013
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 18:25:45 +0000 (18:25 +0000)]
Add support for comdats with names larger than 256 characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226012
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 14 Jan 2015 18:07:30 +0000 (18:07 +0000)]
ReleaseNotes.rst: bump version to 3.7
The 3.6 notes are now in the 3.6 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226007
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 14 Jan 2015 18:05:44 +0000 (18:05 +0000)]
[Hexagon] Removing old versions of cmpb and updating references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226006
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 14 Jan 2015 17:38:03 +0000 (17:38 +0000)]
Trunk is now 3.7.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226004
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 14 Jan 2015 16:49:12 +0000 (16:49 +0000)]
[Hexagon] Deleting versions of compare-not that don't have encoding information. Updating references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226003
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 14 Jan 2015 16:03:58 +0000 (16:03 +0000)]
fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225991
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 14 Jan 2015 15:42:34 +0000 (15:42 +0000)]
R600/SI: Use IMPLICIT_DEF and KILL when failing to spill VGPRs
This helps us avoid 'invalid register class for operand' verifier
errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225989
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 14 Jan 2015 15:42:31 +0000 (15:42 +0000)]
R600/SI: Spill VGPRs to scratch space for compute shaders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225988
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Sallenave [Wed, 14 Jan 2015 15:36:28 +0000 (15:36 +0000)]
Check that the TLI callback enableAggressiveFMAFusion has the desired effect on FMA folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225987
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Sallenave [Wed, 14 Jan 2015 14:47:24 +0000 (14:47 +0000)]
Override the TLI callback enableAggressiveFMAFusion and return true. Indeed, fmul, fmadd and fadd nodes cost the same number of cycles, so we can enable more combining heuristics to produce more fmadd nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225984
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 13:53:50 +0000 (13:53 +0000)]
Handle a symbol being undefined.
This can happen if:
* It is present in a comdat in one file.
* It is not present in the comdat of the file that is kept.
* Is is not used.
This should fix the LTO boostrap.
Thanks to Takumi NAKAMURA for setting up the bot!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225983
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Wed, 14 Jan 2015 11:35:22 +0000 (11:35 +0000)]
Add disassembler tests for mips32r2 platform. There are no functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225980
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Wed, 14 Jan 2015 11:24:47 +0000 (11:24 +0000)]
reapply: SLPVectorizer: Cache results from memory alias checking.
This speeds up the dependency calculations for blocks with many load/store/call instructions.
Beside the improved runtime, there is no functional change.
Compared to the original commit, this re-applied commit contains a bug fix which ensures that there are
no incorrect collisions in the alias cache.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225977
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 11:23:27 +0000 (11:23 +0000)]
[cleanup] Re-sort all the #include lines in LLVM using
utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This
even uncovered a missing include from the InstrProf library that I've
added. No functionality changed here, just mechanical cleanup of the
include order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225974
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyoti Allur [Wed, 14 Jan 2015 10:48:16 +0000 (10:48 +0000)]
Correct POP handling for v7m
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225972
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 10:33:21 +0000 (10:33 +0000)]
[dom] Make the DominatorTreeBase not a dynamic class!
Now that the passes are wrappers around this, we no longer need
a vtable, virtual destructor, and other associated mess. This is
particularly nice to me as this is a class template. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225970
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 10:19:28 +0000 (10:19 +0000)]
[PM] Port domtree to the new pass manager (at last).
This adds the domtree analysis to the new pass manager. The analysis
returns the same DominatorTree result entity used by the old pass
manager and essentially all of the code is shared. We just have
different boilerplate for running and printing the analysis.
I've converted one test to run in both modes just to make sure this is
exercised while both are live in the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225969
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Wed, 14 Jan 2015 10:19:09 +0000 (10:19 +0000)]
[mips] Refine octeon instructions seq/seqi/sne/snei
This commit refines the pattern for the octeon seq/seqi/sne/snei instructions.
The target register is set to 0 or 1 according to the result of the comparison.
In C, this is something like
rd = (unsigned long)(rs == rt)
This commit adds a zext to bring the result to i64. With this change the
instruction is selected for this type of code. (gcc produces the same code for
the above C code.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225968
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Wed, 14 Jan 2015 10:18:56 +0000 (10:18 +0000)]
Add disassembler tests for mips32r2 platform. There are no functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225967
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 10:07:19 +0000 (10:07 +0000)]
[PM] Make DominatorTrees (corectly) movable so that we can move them
into the new pass manager's analysis cache which stores results
by-value.
Technically speaking, the dom trees were originally not movable but
copyable! This, unsurprisingly, didn't work at all -- the copy was
shallow and just resulted in rampant memory corruption. This change
explicitly forbids copying (as it would need to be a deep copy) and
makes them explicitly movable with the unsurprising boiler plate to
member-wise move them because we can't rely on MSVC to generate this
code for us. =/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225966
91177308-0d34-0410-b5e6-
96231b3b80d8
Brad Smith [Wed, 14 Jan 2015 07:53:39 +0000 (07:53 +0000)]
Use the integrated assembler by default on SPARC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225957
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 14 Jan 2015 06:14:36 +0000 (06:14 +0000)]
Use the operand vector instead so inline assembly can be validated too
The buildbots got upset after r225941, this should hopefully fix things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225954
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 06:03:18 +0000 (06:03 +0000)]
SelectionDAG: add a -filter-view-dags option to llc
This option takes the name of the basic block you want to visualize
with -view-*-dags
Differential Revision: http://reviews.llvm.org/D6948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225953
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:45:24 +0000 (05:45 +0000)]
DAG Combiner: Fold SelectCC When Cond is UNDEF
In case folding a node end up with a NaN as operand for the select,
the folding of the condition of the selectcc node returns "UNDEF".
Differential Revision: http://reviews.llvm.org/D6889
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225952
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:38:48 +0000 (05:38 +0000)]
Add assertions for out of bound index in ComputeLinearIndex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225951
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 14 Jan 2015 05:37:10 +0000 (05:37 +0000)]
X86: only access operands if they are present
If there is no associated immediate (MS style inline asm), do not try to access
the operand, assume that it is valid. This should fix the buildbots after SVN
r225941.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225950
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:33:01 +0000 (05:33 +0000)]
Fold a loop for array processing in ComputeLinearIndex
When processing an array, every Elt has the same layout, it is
useless to recursively call each ComputeLinearIndex on each element.
Just do it once and multiply by the number of elements.
Differential Revision: http://reviews.llvm.org/D6832
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225949
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 14 Jan 2015 05:24:33 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (llvm)"
This reverts commit:
http://reviews.llvm.org/D3392
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225948
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:14:30 +0000 (05:14 +0000)]
NVPTX: Use MapMetadata() instead of custom/stale/untested logic
Copy the `GVMap` over to a standard `ValueToValueMapTy` so that we can
reuse the `MapMetadata()` logic. Unfortunately the `GVMap` can't just
be replaced, since `MapMetadata()` likes to modify the map, but at least
this will prevent NVPTX from bitrotting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225944
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:13:18 +0000 (05:13 +0000)]
NVPTX: Remove bogus remap logic for global variable address spaces
The comment is incorrect, and the code mangles debug info. Remove the
bad logic, which wasn't tested anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225943
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 14 Jan 2015 05:10:21 +0000 (05:10 +0000)]
X86: validate 'int' instruction
The int instruction takes as an operand an 8-bit immediate value. Validate that
the input is valid rather than silently truncating the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225941
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 14 Jan 2015 04:21:33 +0000 (04:21 +0000)]
Disable a couple of tests, CodeGen/X86/noop-insert.ll and CodeGen/X86/noop-insert-percentage.ll, in r225908, to unbreak tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225940
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:58:50 +0000 (03:58 +0000)]
[dom] Remove extraneous inline keywords. Template functions and inline
class members are implicitly "inline", no key word needed.
Naturally, this could change how LLVM inlines these functions because
<GRR>, but that's not an excuse to use the keyword. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225939
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:56:00 +0000 (03:56 +0000)]
[dom] The formatting of the generic domtree has bitrotted over the years
significantly. Clean it up with the help of clang-format.
I've touched this up by hand in a couple of places that weren't quite
right (IMO). I think most of these actually have bugs open about
already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225938
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:55:58 +0000 (03:55 +0000)]
[dom] Clean up some comments in this header that were confusingly
formatted or placed incorrectly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225937
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:34:55 +0000 (03:34 +0000)]
[dom] Add a basic dominator tree test.
Correct, we have *zero* basic testing of the dominator tree in the
regression test suite. There is a single test that even prints it out,
and that test only checks a single line of the output. There are
a handful of tests that check post dominators, but all of those are
looking for bugs rather than just exercising the basic machinery.
This test is super boring and unexciting. But hey, it's something.
I needed there to be something so I could switch the basic test to run
with both the old and new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225936
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Wed, 14 Jan 2015 03:02:16 +0000 (03:02 +0000)]
Fix a wrong comment in LoopVectorize.
I.E. more than two -> exactly two
Fix a typo function name in LoopVectorize.
I.E. collectStrideAcccess() -> collectStrideAccess()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225935
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 14 Jan 2015 02:24:10 +0000 (02:24 +0000)]
TargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225933
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 14 Jan 2015 01:50:12 +0000 (01:50 +0000)]
Disable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
complain that the flag doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225931
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 14 Jan 2015 01:43:33 +0000 (01:43 +0000)]
ARM: add test for crc32 instructions in CodeGen.
Somehow we seem to have ended up without any actual tests of the
CodeGen side. Easy enough to fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225930
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:42:43 +0000 (01:42 +0000)]
Remove trailing slash from r225924
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225929
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:37:21 +0000 (01:37 +0000)]
[PowerPC] Fix the noop-insert test
The form of nops used is CPU-specific (some CPUs, such as the POWER7, have
special group-terminating nops). We probably want a different callback for this
kind of nop insertion (something more like MCAsmBackend::writeNopData), or for
PPC to use a different mechanism for scheduling nops, but this will stop the
test from failing for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225928
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:26 +0000 (01:35 +0000)]
R600/SI: Remove some redudant load testcases.
This reduces coverage for Evergreen, since the more
complete tests have those run lines disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225927
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:22 +0000 (01:35 +0000)]
R600/SI: Fix bad code with unaligned byte vector loads
Don't do the v4i8 -> v4f32 combine if the load will need to
be expanded due to alignment. This stops adding instructions
to repack into a single register that the v_cvt_ubyteN_f32
instructions read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225926
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:17 +0000 (01:35 +0000)]
Implement new way of expanding extloads.
Now that the source and destination types can be specified,
allow doing an expansion that doesn't use an EXTLOAD of the
result type. Try to do a legal extload to an intermediate type
and extend that if possible.
This generalizes the special case custom lowering of extloads
R600 has been using to work around this problem.
This also happens to fix a bug that would incorrectly use more
aligned loads than should be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225925
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:31:34 +0000 (01:31 +0000)]
Utils: Remove unreachable break, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225924
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:29:32 +0000 (01:29 +0000)]
Utils: Handle remapping distinct MDLocations
Part of PR21433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225921
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:24:38 +0000 (01:24 +0000)]
Utils: Thread distinct-ness through the cloneMD*() functions, NFC
The new logic isn't actually reachable yet, so no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225918
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:22:47 +0000 (01:22 +0000)]
Utils: Extract cloneMDNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225917
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:21:24 +0000 (01:21 +0000)]
Utils: Move cloneMD*() up, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225915
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:20:27 +0000 (01:20 +0000)]
Utils: Add mapping for uniqued MDLocations
Still doesn't handle distinct ones. Part of PR21433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225914
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 14 Jan 2015 01:13:19 +0000 (01:13 +0000)]
R600/SI: Define a schedule model
The machine scheduler is still disabled by default.
The schedule model is not complete yet, and could be improved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225913
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:12:14 +0000 (01:12 +0000)]
Utils: Extract cloneMDTuple(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225912
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:08:47 +0000 (01:08 +0000)]
Utils: Extract shouldRemapUniquedNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225911
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:07:51 +0000 (01:07 +0000)]
Revert "r225811 - Revert "r225808 - [PowerPC] Add StackMap/PatchPoint support""
This re-applies r225808, fixed to avoid problems with SDAG dependencies along
with the preceding fix to ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs.
These problems caused the original regression tests to assert/segfault on many
(but not all) systems.
Original commit message:
This commit does two things:
1. Refactors PPCFastISel to use more of the common infrastructure for call
lowering (this lets us take advantage of this common code for lowering some
common intrinsics, stackmap/patchpoint among them).
2. Adds support for stackmap/patchpoint lowering. For the most part, this is
very similar to the support in the AArch64 target, with the obvious differences
(different registers, NOP instructions, etc.). The test cases are adapted
from the AArch64 test cases.
One difference of note is that the patchpoint call sequence takes 24 bytes, so
you can't use less than that (on AArch64 you can go down to 16). Also, as noted
in the docs, we take the patchpoint address to be the actual code address
(assuming the call is local in the TOC-sharing sense), which should yield
higher performance than generating the full cross-DSO indirect-call sequence
and is likely just as useful for JITed code (if not, we'll change it).
StackMaps and Patchpoints are still marked as experimental, and so this support
is doubly experimental. So go ahead and experiment!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225909
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 14 Jan 2015 01:07:26 +0000 (01:07 +0000)]
Insert random noops to increase security against ROP attacks (llvm)
A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks.
Command line options:
-noop-insertion // Enable noop insertion.
-noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion)
-max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions.
In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future).
-fdiversify
This is the llvm part of the patch.
clang part: D3393
http://reviews.llvm.org/D3392
Patch by Stephen Crane (@rinon)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225908
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:07:03 +0000 (01:07 +0000)]
Adjust ScheduleDAGSDNodes::RegDefIter for patchpoints
PATCHPOINT is a strange pseudo-instruction. Depending on how it is used, and
whether or not the AnyReg calling convention is being used, it might or might
not define a value. However, its TableGen definition says that it defines one
value, and so when it doesn't, the code in ScheduleDAGSDNodes::RegDefIter
becomes confused and the code that uses the RegDefIter will try to get the
register class of the MVT::Other type associated with the PATCHPOINT's chain
result (under certain circumstances).
This will be covered by the PPC64 PatchPoint test cases once that support is
re-committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225907
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:07:03 +0000 (01:07 +0000)]
Utils: Simplify code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225906
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:06:21 +0000 (01:06 +0000)]
Utils: Extract mapUniquedNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225905
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 14 Jan 2015 01:05:27 +0000 (01:05 +0000)]
CodeGen support for x86_64 SEH catch handlers in LLVM
This adds handling for ExceptionHandling::MSVC, used by the
x86_64-pc-windows-msvc triple. It assumes that filter functions have
already been outlined in either the frontend or the backend. Filter
functions are used in place of the landingpad catch clause type info
operands. In catch clause order, the first filter to return true will
catch the exception.
The C specific handler table expects the landing pad to be split into
one block per handler, but LLVM IR uses a single landing pad for all
possible unwind actions. This patch papers over the mismatch by
synthesizing single instruction BBs for every catch clause to fill in
the EH selector that the landing pad block expects.
Missing functionality:
- Accessing data in the parent frame from outlined filters
- Cleanups (from __finally) are unsupported, as they will require
outlining and parent frame access
- Filter clauses are unsupported, as there's no clear analogue in SEH
In other words, this is the minimal set of changes needed to write IR to
catch arbitrary exceptions and resume normal execution.
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D6300
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225904
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:05:17 +0000 (01:05 +0000)]
Utils: MDNode => UniquableMDNode, NFC
Although this makes the `cast<>` assert more often, the
`assert(Node->isResolved())` on the following line would assert in all
those cases. So, no functionality change here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225903
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:03:05 +0000 (01:03 +0000)]
Utils: Separate out mapDistinctNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225902
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:02:17 +0000 (01:02 +0000)]
Utils: Use helper function directly, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225901
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:30 +0000 (01:01 +0000)]
Debug Info: Implement DwarfCompileUnit::addComplexAddress() using
DIEDwarfExpression (and get rid of a bunch of redundant code).
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225900
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:28 +0000 (01:01 +0000)]
Debug Info: Emitting a register in DwarfExpression may fail. Report the
status in a bool and let the users deal with the error.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225899
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:22 +0000 (01:01 +0000)]
Debug Info: Move DIEDwarfExpression into DwarfExpression.h because it
needs to be accessed from both DwarfCompileUnit.cpp and DwarfUnit.cpp.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225898
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:01:19 +0000 (01:01 +0000)]
Utils: Extract helper function, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225897
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 00:59:57 +0000 (00:59 +0000)]
Utils: Use MDTuple::get() directly, NFC
Working towards supporting `MDLocation` in `MapMetadata()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225896
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 14 Jan 2015 00:55:05 +0000 (00:55 +0000)]
[SimplifyLibCalls] Don't try to simplify indirect calls.
It turns out, all callsites of the simplifier are guarded by a check for
CallInst::getCalledFunction (i.e., to make sure the callee is direct).
This check wasn't done when trying to further optimize a simplified fortified
libcall, introduced by a refactoring in r225640.
Fix that, add a testcase, and document the requirement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225895
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 14 Jan 2015 00:50:33 +0000 (00:50 +0000)]
Remove unused predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225893
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 14 Jan 2015 00:50:31 +0000 (00:50 +0000)]
Migrate ABIName to MCTargetOptions so that it can be shared between
the TargetMachine level and the MC level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225891
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 00:39:56 +0000 (00:39 +0000)]
Don't set LD_PRELOAD to ''. It doesn't work on OpenBSD.
Patch by Brad Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225890
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 00:27:45 +0000 (00:27 +0000)]
Revert r225854: [PM] Move the LazyCallGraph printing functionality to
a print method.
This was formulated on a bad idea, but sadly I didn't uncover how bad
this was until I got further down the path. I had hoped that we could
provide a low boilerplate way of printing analyses, but it just doesn't
seem like this really fits the needs of the analyses. Not all analyses
really want to do printing, and those that do don't all use the same
interface. Instead, with the new pass manager let's just take advantage
of the fact that creating an explicit printer pass like the LCG has is
pretty low boilerplate already and rely on that for testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225861
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 00:15:16 +0000 (00:15 +0000)]
Debug Info: Don't bother emitting DW_AT_frame_base if the function has
no frame register. "Tested" via an assertion triggered by DwarfExpression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225858
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 00:15:12 +0000 (00:15 +0000)]
Revert "Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a"
This reverts commit r225852, it was a bad idea.
MachineReg should always be a physical register. If it isn't this DebugLoc
shouldn't have been created in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225857
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 23:53:50 +0000 (23:53 +0000)]
[PM] Move the LazyCallGraph printing functionality to a print method.
I'm adding generic analysis printing utility pass support which will
require such a method (or a specialization) so this will let the
existing printing logic satisfy that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225854
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:39:15 +0000 (23:39 +0000)]
Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a
physical register. The call to getMinimalPhysRegClass() later on asserts
on this condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225852
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:39:11 +0000 (23:39 +0000)]
Debug Info: Move the complex expression handling (=the remainder) of
emitDebugLocValue() into DwarfExpression.
Ought to be NFC, but it actually uncovered a bug in the debug-loc-asan.ll
testcase. The testcase checks that the address of variable "y" is stored
at [RSP+16], which also lines up with the comment.
It also check(ed) that the *value* of "y" is stored in RDI before that,
but that is actually incorrect, since RDI is the very value that is
stored in [RSP+16]. Here's the assembler output:
movb
2147450880(%rcx), %r8b
#DEBUG_VALUE: bar:y <- RDI
cmpb $0, %r8b
movq %rax, 32(%rsp) # 8-byte Spill
movq %rsi, 24(%rsp) # 8-byte Spill
movq %rdi, 16(%rsp) # 8-byte Spill
.Ltmp3:
#DEBUG_VALUE: bar:y <- [RSP+16]
Fixed the comment to spell out the correct register and the check to
expect an address rather than a value.
Note that the range that is emitted for the RDI location was and is still
wrong, it claims to begin at the function prologue, but really it should
start where RDI is first assigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225851
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 13 Jan 2015 23:27:55 +0000 (23:27 +0000)]
[AVX512] Add 16x32 unpck tests as well
Forgot this from r225838.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225850
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:11:51 +0000 (23:11 +0000)]
cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225848
91177308-0d34-0410-b5e6-
96231b3b80d8