Hal Finkel [Thu, 31 Jul 2014 19:13:38 +0000 (19:13 +0000)]
Fix ScalarEvolutionExpander when creating a PHI in a block with duplicate predecessors
It seems that when I fixed this, almost exactly a year ago, I did not quite do
it correctly. When we have duplicate block predecessors, we can indeed not have
different incoming values for the same block, but we *must* have duplicate
entries. So, instead of skipping the duplicates, we explicitly add the
duplicate incoming values.
Fixes PR20442.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214423
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 31 Jul 2014 18:46:24 +0000 (18:46 +0000)]
verify-uselistorder: Change the default -num-shuffles=5
Change the default for `-num-shuffles` to 5 and better document the
algorithm in the header docs of `verify-uselistorder`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214419
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 31 Jul 2014 18:43:43 +0000 (18:43 +0000)]
Create a default symver on Linux like ELF OSes.
Patch by Adam Jackson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214418
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 31 Jul 2014 18:33:12 +0000 (18:33 +0000)]
UseListOrder: Handle self-users
Correctly sort self-users (such as PHI nodes). I added a targeted test
in `test/Bitcode/use-list-order.ll` and the final missing RUN line to
tests in `test/Assembly`.
This is part of PR5680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214417
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 31 Jul 2014 18:28:08 +0000 (18:28 +0000)]
Fix loop end condition.
Note: This code appears to be untested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214416
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 31 Jul 2014 15:20:30 +0000 (15:20 +0000)]
Wrong heading level for PowerPC changes in release notes
Oops. Used the wrong heading level by mistake.
Thanks,
Bill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214405
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 31 Jul 2014 15:17:33 +0000 (15:17 +0000)]
Release Notes: Overriding PPC64 and PPC64LE ABI defaults is not yet supported.
I wrongly included a description of a patch that came in after 3.5 branched
and has not been backported.
Thanks,
Bill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214404
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 31 Jul 2014 14:38:17 +0000 (14:38 +0000)]
Add PowerPC release notes for 3.5.
Here's my take on 3.5 changes for PowerPC. Others please feel free to add,
edit, delete as desired.
Thanks,
Bill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214403
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 31 Jul 2014 12:58:50 +0000 (12:58 +0000)]
Fixing an -Woverloaded-virtual warnings by exposing the hidden virtual function as well. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214400
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 31 Jul 2014 12:55:49 +0000 (12:55 +0000)]
Fixing a -Wcast-qual warning in GCC. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214399
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 31 Jul 2014 11:02:27 +0000 (11:02 +0000)]
[msan] Fix handling of array types.
Switch array type shadow from a single integer to
an array of integers (i.e. make it per-element).
This simplifies instrumentation of extractvalue and fixes PR20493.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214398
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 31 Jul 2014 09:11:04 +0000 (09:11 +0000)]
[asan] Support x86 REP MOVS asm instrumentation.
Patch by Yuri Gorshenin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214395
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Thu, 31 Jul 2014 07:16:59 +0000 (07:16 +0000)]
MergeFunctions, tiny refactoring:
cmpOperation has been renamed to cmpOperations (multiple form).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214392
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 06:25:37 +0000 (06:25 +0000)]
[FastISel][AArch64] Add basic bitcast support for conversion between float and int.
Fixes <rdar://problem/
17867078>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214389
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 06:25:33 +0000 (06:25 +0000)]
[FastISel][AArch64] Add sqrt intrinsic support.
Fixes <rdar://problem/
17867067>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214388
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 31 Jul 2014 04:49:29 +0000 (04:49 +0000)]
InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+A
We can only propagate the nsw bits if both subtraction instructions are
marked with the appropriate bit.
N.B. We only propagate the nsw bit in InstCombine because the nuw case
is already handled in InstSimplify.
This fixes PR20189.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214385
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 31 Jul 2014 04:49:18 +0000 (04:49 +0000)]
InstSimplify: Simplify (X - (0 - Y)) if the second sub is NUW
If the NUW bit is set for 0 - Y, we know that all values for Y other
than 0 would produce a poison value. This allows us to replace (0 - Y)
with 0 in the expression (X - (0 - Y)) which will ultimately leave us
with X.
This partially fixes PR20189.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214384
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 31 Jul 2014 04:25:36 +0000 (04:25 +0000)]
Fix some grammatical errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214383
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 04:10:43 +0000 (04:10 +0000)]
[FastISel][AArch64] Update and enable patchpoint and stackmap intrinsic tests for FastISel.
This commit updates the existing SelectionDAG tests for the stackmap and patchpoint
intrinsics and enables FastISel testing. It also splits up the tests into separate
files, due to different codegen between SelectionDAG and FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214382
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 04:10:40 +0000 (04:10 +0000)]
[FastISel][AArch64] Add MachO large code model support for function calls.
Currently the large code model for MachO uses the GOT to make function calls.
Emit the required adrp and ldr instructions to load the address from the GOT.
Related to <rdar://problem/
17733076>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214381
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Jul 2014 03:36:00 +0000 (03:36 +0000)]
A std::unique_ptr case I missed in the previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214379
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Jul 2014 03:12:45 +0000 (03:12 +0000)]
Use std::unique_ptr to make the ownership explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214377
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 31 Jul 2014 01:44:00 +0000 (01:44 +0000)]
Don't fail tablegen immediately after failing to set a value.
Instead allow the variable to be declared, but don't attach an initializer. This allows more than a single error to be emitted before we exit.
Test case to follow soon in another patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214375
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 31 Jul 2014 01:43:57 +0000 (01:43 +0000)]
Add a better error message when failing to assign one tablegen value to another
This is currently for assigning from one bit init to another. It can easily be extended to other types.
Test to follow soon in another patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214374
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 31 Jul 2014 01:43:54 +0000 (01:43 +0000)]
Fix bit initializer which was one bit too long, but worked so long as we silently dropped the leading 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214373
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 31 Jul 2014 01:43:51 +0000 (01:43 +0000)]
Fix bit initializer which was one bit too long, but worked so long as we silently dropped the leading 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214372
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Jul 2014 01:14:09 +0000 (01:14 +0000)]
Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214370
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 31 Jul 2014 00:13:28 +0000 (00:13 +0000)]
UseListOrder: Don't give constant IDs to GlobalValues
Since initializers of GlobalValues are being assigned IDs before
GlobalValues themselves, explicitly exclude GlobalValues from the
constant pool. Added targeted test in `test/Bitcode/use-list-order.ll`
and added two more RUN lines in `test/Assembly`.
This is part of PR5680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214368
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 00:11:16 +0000 (00:11 +0000)]
[FastISel] Fix the patchpoint intrinsic lowering in FastISel for large target addresses.
This fixes a mistake where I accidentially dropped the upper 32bit of a
64bit pointer during FastISel lowering of the patchpoint intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214367
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 31 Jul 2014 00:11:11 +0000 (00:11 +0000)]
[FastISel][AArch64 and X86] Don't emit stores for UNDEF arguments during function call lowering.
UNDEF arguments are not ment to be touched - especially for the webkit_js
calling convention. This fix reproduces the already existing behavior of
SelectionDAG in FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214366
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 31 Jul 2014 00:10:27 +0000 (00:10 +0000)]
verify-uselistorder: Add RUN lines to cases in test/Assembly
Add RUN line for `verify-uselistorder` to every test in `test/Assembly`,
unless it's a negative check (assembler rejects it) or verification
fails.
There are three files that verification fails on (so I've left out the
RUN lines):
- 2002-08-22-DominanceProblem.ll
- ConstantExprFold.ll
- ConstantExprFoldCast.ll
This is part of PR5680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214365
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 31 Jul 2014 00:07:33 +0000 (00:07 +0000)]
X86 asm parser: Avoid duplicating the list of aliased instructions
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214364
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 23:59:11 +0000 (23:59 +0000)]
Add mtpid/mfpid for BookE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214363
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 23:39:30 +0000 (23:39 +0000)]
Attempt at fixing the windows dll build.
It looks like only direct (i.e., explicitly listed) dependencies are
scanned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214361
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 30 Jul 2014 23:36:06 +0000 (23:36 +0000)]
llvm-profdata: Add a test for mismatched numbers of counters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214360
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 30 Jul 2014 23:02:01 +0000 (23:02 +0000)]
llvm-profdata: Use consistent file suffixes in tests
In some places we've been using different suffixes for the different
file formats involved in instrprof, but in others we've just
ambiguously used .profdata. Update the test files to indicate the
types of file more obviously.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214357
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 22:51:54 +0000 (22:51 +0000)]
Use "weak alias" instead of "alias weak"
Before this patch we had
@a = weak global ...
but
@b = alias weak ...
The patch changes aliases to look more like global variables.
Looking at some really old code suggests that the reason was that the old
bison based parser had a reduction for alias linkages and another one for
global variable linkages. Putting the alias first avoided the reduce/reduce
conflict.
The days of the old .ll parser are long gone. The new one parses just "linkage"
and a later check is responsible for deciding if a linkage is valid in a
given context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214355
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 22:51:15 +0000 (22:51 +0000)]
Refactor TLBIVAX and add tlbsx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214354
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 30 Jul 2014 22:23:11 +0000 (22:23 +0000)]
X86 asm parser: Use a loop to disambiguate suffixes instead of copy paste
This works towards making the Intel syntax asm matcher use a completely
different disambiguation strategy.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214352
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:37 +0000 (22:04 +0000)]
[FastISel][AArch64] Add select folding support for the XALU intrinsics.
This improves the code generation for the XALU intrinsics when the
condition is feeding a select instruction.
This also updates and enables the XALU unit tests for FastISel.
This fixes <rdar://problem/
17831117>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214350
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:34 +0000 (22:04 +0000)]
[FastISel][AArch64] Add branch folding support for the XALU intrinsics.
This improves the code generation for the XALU intrinsics when the
condition is feeding a branch instruction.
This is related to <rdar://problem/
17831117>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214349
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:31 +0000 (22:04 +0000)]
[FastISel][AArch64] Add {s|u}{add|sub|mul}.with.overflow intrinsic support.
This commit adds support for the {s|u}{add|sub|mul}.with.overflow intrinsics.
The unit tests for FastISel will be enabled in a later commit, once there is
also branch and select folding support.
This is related to <rdar://problem/
17831117>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214348
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:28 +0000 (22:04 +0000)]
[FastISel] Move the helper function isCommutativeIntrinsic into FastISel base class.
Move the helper function isCommutativeIntrinsic into the FastISel base class,
so it can be used by more than just one backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214347
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:25 +0000 (22:04 +0000)]
[FastISel][AArch64] Create helper functions to create the various multiplies on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214346
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Jul 2014 22:04:22 +0000 (22:04 +0000)]
[FastISel][AArch64] Add support for shift-immediate.
Currently the shift-immediate versions are not supported by tblgen and
hopefully this can be later removed, once the required support has been
added to tblgen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214345
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 30 Jul 2014 21:26:37 +0000 (21:26 +0000)]
InstCombine: Simplify (A ^ B) or/and (A ^ B ^ C)
While we can already transform A | (A ^ B) into A | B, things get bad
once we have (A ^ B) | (A ^ B ^ Cst) because reassociation will morph
this into (A ^ B) | ((A ^ Cst) ^ B). Our existing patterns fail once
this happens.
To fix this, we add a new pattern which looks through the tree of xor
binary operators to see that, in fact, there exists a redundant xor
operation.
What follows bellow is a correctness proof of the transform using CVC3.
$ cat t.cvc
A, B, C : BITVECTOR(64);
QUERY BVXOR(A, B) | BVXOR(BVXOR(B, C), A) = BVXOR(A, B) | C;
QUERY BVXOR(BVXOR(A, C), B) | BVXOR(A, B) = BVXOR(A, B) | C;
QUERY BVXOR(A, B) & BVXOR(BVXOR(B, C), A) = BVXOR(A, B) & ~C;
QUERY BVXOR(BVXOR(A, C), B) & BVXOR(A, B) = BVXOR(A, B) & ~C;
$ cvc3 < t.cvc
Valid.
Valid.
Valid.
Valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214342
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 21:09:03 +0000 (21:09 +0000)]
Add rfdi and rfmci from the e500/e500mc ISA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214339
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 30 Jul 2014 21:07:56 +0000 (21:07 +0000)]
SLP Vectorizer: Canonicalize tree operands of commutitive binary operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214338
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 21:04:00 +0000 (21:04 +0000)]
SimplifyCFG: Avoid miscompilations due to removed lifetime intrinsics.
The lifetime intrinsics need some work in order to make it clear which
optimizations are or are not valid.
For now dropping this optimization avoids a miscompilation.
Patch by Björn Steinbrink.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214336
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 20:44:04 +0000 (20:44 +0000)]
Add BookE's tlbre, tlbwe and tlbivax instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214332
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 30 Jul 2014 20:30:11 +0000 (20:30 +0000)]
docs: update the command guide documentation for llvm-profdata.
Differential Revision: http://reviews.llvm.org/D4726
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214331
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Wed, 30 Jul 2014 20:26:09 +0000 (20:26 +0000)]
Fix test case introduced in r214322
This patch adds an explicit triple to the test case introduced by r214322. This
should fix build failueres that are occuring on bots that are cross building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214330
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 30 Jul 2014 20:02:08 +0000 (20:02 +0000)]
LangRef: add a note about the mangling-suppressing \01 prefix
Someone asked about this on IRC the other day, and I couldn't
find the magic prefix documented anywhere.
Differential Revision: http://reviews.llvm.org/D4728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214329
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 19:42:16 +0000 (19:42 +0000)]
Refactor duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214328
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 30 Jul 2014 19:23:59 +0000 (19:23 +0000)]
Fixing a few -Woverloaded-virtual warnings by exposing the hidden virtual function as well. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214325
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Wed, 30 Jul 2014 18:24:41 +0000 (18:24 +0000)]
Retain alignment requirements for load->selects modified by DAGCombine
DAGCombine may choose to rewrite graphs where two loads feed a select into
graphs where a select of two addresses feed a load. While it sanity checks the
loads to make sure they are broadly equivalent it currently just uses the
alignment restriction of the left node. In cases where the right node has
stronger alignment requiresment this may lead to bad codegen, such as generating
an aligned load where an unaligned load is required. This patch makes the
combine generate a load with an alignment that is the same as whichever is more
restrictive of the two alignments.
Tests included.
rdar://
17762530
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214322
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:51:09 +0000 (17:51 +0000)]
UseListOrder: Visit global values
When predicting use-list order, we visit functions in reverse order
followed by `GlobalValue`s and write out use-lists at the first
opportunity. In the reader, this will translate to *after* the last use
has been added.
For this to work, we actually need to descend into `GlobalValue`s.
Added a targeted test in `use-list-order.ll` and `RUN` lines to the
newly passing tests in `test/Bitcode`.
There are two remaining failures in `test/Bitcode`:
- blockaddress.ll: I haven't thought through how to model the way
block addresses change the order of use-lists (or how to work around
it).
- metadata-2.ll: There's an old-style `@llvm.used` global array here
that I suspect the .ll parser isn't upgrading properly. When it
round-trips through bitcode, the .bc reader *does* upgrade it, so
the extra variable (`i8* null`) has an extra use, and the shuffle
vector doesn't match.
I think the fix is to upgrade old-style global arrays (or reject
them?) in the .ll parser.
This is part of PR5680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214321
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:49:00 +0000 (17:49 +0000)]
Fix line endings before adding RUN lines, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214320
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:11:27 +0000 (17:11 +0000)]
Rename llvm-uselistorder => verify-uselistorder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214318
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 16:59:19 +0000 (16:59 +0000)]
llvm-uselistorder: Improve the tool description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214317
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 16:50:22 +0000 (16:50 +0000)]
llvm-uselistorder: Fix memory leak from r214125
Turns out `parseBitcodeFile()` does *not* take ownership of the buffer.
This was already clear in the header docs, but I obviously didn't read
them (having noticed that it gets stored in a `unique_ptr<>`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214313
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 15:57:51 +0000 (15:57 +0000)]
Add the missing hasLinkOnceODRLinkage predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214312
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 15:31:21 +0000 (15:31 +0000)]
Add a small test showing when a linkonce_odr symbol can be hidden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214311
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Jacob [Wed, 30 Jul 2014 12:30:06 +0000 (12:30 +0000)]
Correct vector type definition in LangRef.
According to VectorType::isValidElementType, any integer, floating point
or pointer type is a valid vector element type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214302
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 10:32:51 +0000 (10:32 +0000)]
Add BookE's wrtee and wrteei instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214297
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 30 Jul 2014 09:24:37 +0000 (09:24 +0000)]
SPRG 0 to 3 are valid outside BookE, so move them to the normal test
file. Add support for accessing SPRG 4 to 7 on BookE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214295
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 30 Jul 2014 05:44:04 +0000 (05:44 +0000)]
Don't manually (and forcibly) run the verifier on the entire module from
the jump instruction table pass. First, the verifier is already built
into all the tools. The test case is adapted to just run llvm-as
demonstrating that we still catch the broken module. Second, the
verifier is *extremely* slow. This was responsible for very significant
compile time regressions.
If you have deployed a Clang binary anywhere from r210280 to this
commit, you really want to re-deploy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214287
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 30 Jul 2014 03:35:05 +0000 (03:35 +0000)]
[MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.
We now (1) correctly decode the branch immediate, (2) modify the immediate to
corretly treat it as PC-rel, and (3) properly populate the stub entry.
Previously we had been doing each of these wrong.
<rdar://problem/
17750739>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214285
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 30 Jul 2014 03:20:45 +0000 (03:20 +0000)]
[PowerPC] Add JMP_SLOT relocation definitions
This will be required by upcoming patches for LLDB support.
Patch by Justin Hibbits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214284
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Jul 2014 03:18:57 +0000 (03:18 +0000)]
R600/SI: Remove redundant setting of bits on instructions.
neverHasSideEffects is deprecated, and hasSideEffects = 0 is already
set on the base classes of the basic ALU instruction classes. The
base classes also already set mayLoad = 0 and mayStore = 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214283
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 30 Jul 2014 03:12:41 +0000 (03:12 +0000)]
[MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.
This line was accidentally left out of that patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214282
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 01:52:40 +0000 (01:52 +0000)]
Use range loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214280
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 01:36:32 +0000 (01:36 +0000)]
Convert a few more function pointer calls to just "f()".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214276
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 30 Jul 2014 01:30:51 +0000 (01:30 +0000)]
[AVX512] Test that _mm512_set1_* intrinsics generate broadcasts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214275
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 30 Jul 2014 01:30:45 +0000 (01:30 +0000)]
[AVX512] Add missing CHECK-LABEL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214273
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 01:23:45 +0000 (01:23 +0000)]
Don't duplicate the function name in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214272
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 01:22:16 +0000 (01:22 +0000)]
Reapply "UseListOrder: Order GlobalValue uses after initializers"
This reverts commit r214249, reapplying r214242 and r214243, now that
r214270 has fixed the UB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214271
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 01:20:26 +0000 (01:20 +0000)]
UseListOrder: Fix undefined behaviour
This commit fixes undefined behaviour that caused the revert in r214249.
The problem was two unsequenced operations on a `DenseMap<>`, giving
different behaviour in GCC and Clang. This:
DenseMap<T*, unsigned> DM;
for (auto &X : ...)
DM[&X] = DM.size() + 1;
should have been:
DenseMap<T*, unsigned> DM;
for (auto &X : ...) {
unsigned Size = DM.size();
DM[&X] = Size + 1;
}
Until r214242, this difference between compilers didn't matter. In
r214242, `OrderMap::LastGlobalValueID` was introduced and compared
against IDs, which in GCC were off-by-one my expectations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214270
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Jul 2014 01:01:10 +0000 (01:01 +0000)]
R600/SI: Consider adjacent offsets in getLdStBaseRegImmOfs
We can treat ds_read2_* as a single offset if the offsets are adjacent.
No test since emission of read2 instructions for partially
aligned loads isn't implemented yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214269
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Wed, 30 Jul 2014 00:44:03 +0000 (00:44 +0000)]
Add support for scalarizing ctlz_zero_undef
Fix the missing case in ScalarizeVectorResult() that was exposed with
libclcore.bc in Android.
Differential Revision: http://reviews.llvm.org/D4645
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214266
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Jul 2014 00:38:58 +0000 (00:38 +0000)]
Use function pointers with just f(1,2) instead of (*f)(1,2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214265
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 00:25:33 +0000 (00:25 +0000)]
Revert "UseListOrder: Remove move assignment"
This reverts commit r214260. Turns out move assignment *is* necessary
for MSVC [1].
[1]: http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/9631
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214264
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 30 Jul 2014 00:25:24 +0000 (00:25 +0000)]
Header hygiene: remove using directive and #undef DEBUG_TYPE once we're done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214263
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 00:05:02 +0000 (00:05 +0000)]
UseListOrder: Remove move assignment
Remove the move assignment added in r214213, since it wasn't necessary
to fix the bots (r214224 was the magic touch).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214260
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Jul 2014 23:45:20 +0000 (23:45 +0000)]
Add rfci instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214256
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 29 Jul 2014 23:43:13 +0000 (23:43 +0000)]
[MCJIT] Add options to llvm-rtdyld to describe a phony target address space for
use in -verify mode.
This patch adds three hidden command line options to llvm-rtdyld:
-target-addr-start <start-addr> : Specify the start of the virtual address
space on the phony target.
-target-addr-end <end-addr> : Specify the end of the virtual address space
on the phony target.
-target-section-sep <sep> : Specify the separation (in bytes) between the
end of one section and the start of the next.
These options automatically default to sane values for the target platform. In
particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from
wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers.
The section separation option defaults to zero, but can be set to a large number
(e.g. 1 << 32) to force large separations between sections in order to
stress-test large-code-model code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214255
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Jul 2014 23:31:27 +0000 (23:31 +0000)]
mbar without argument is equivalent to mbar 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214250
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:31:11 +0000 (23:31 +0000)]
Revert "UseListOrder: Order GlobalValue uses after initializers"
This reverts commits r214242 and r214243 while I investigate buildbot
failures [1][2][3]. I can't reproduce these failures locally, so if
anyone can see what I've done wrong, I'd appreciate a note.
[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9840
[2]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/14981
[3]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/15191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214249
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Jul 2014 23:16:31 +0000 (23:16 +0000)]
Recognize BookE's mbar instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214244
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:15:49 +0000 (23:15 +0000)]
UseListOrder: Additional test coverage for r214242
r214242 was subtle enough it really deserves a targeted test with
comments. This adds some global variables that trigger the relevant
code path. Sorry this wasn't committed with the fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214243
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:06:14 +0000 (23:06 +0000)]
UseListOrder: Order GlobalValue uses after initializers
To avoid unnecessary forward references, the reader doesn't process
initializers of `GlobalValue`s until after the constant pool has been
processed, and then in reverse order. Model this when predicting
use-list order. This gets two more Bitcode tests passing with
`llvm-uselistorder`.
Part of PR5680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214242
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:03:40 +0000 (23:03 +0000)]
UseListOrder: Create a struct around OrderMap, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214241
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Jul 2014 22:58:13 +0000 (22:58 +0000)]
Feedback on r214189, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214240
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 29 Jul 2014 22:57:59 +0000 (22:57 +0000)]
Add missing test for r214210.
Thanks dblaikie for reminding me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214239
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Jul 2014 22:42:44 +0000 (22:42 +0000)]
Fix typo in alias: DSIR -> DSISR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214238
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 29 Jul 2014 22:29:23 +0000 (22:29 +0000)]
llvm-profdata: Clean up and reorganize some tests
This moves some tests around to make it clearer what's being tested,
and adds very rudimentary comment syntax to the text input format to
make specifying this kind of test a little bit simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214235
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Jul 2014 22:21:57 +0000 (22:21 +0000)]
Support move to/from segment register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214234
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 29 Jul 2014 21:48:22 +0000 (21:48 +0000)]
[MCJIT] XFAIL some RuntimeDyld tests on MIPS - RuntimeDyldChecker isn't properly
endian-aware yet, and this is causing failures when cross-linking on MIPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214231
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Jul 2014 21:46:05 +0000 (21:46 +0000)]
Use nullptr instead of NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214229
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 29 Jul 2014 21:42:24 +0000 (21:42 +0000)]
Coverage: improve efficiency of the counter propagation to the expansion regions.
This patch reduces the complexity of the two inner loops in order to speed up
the loading of coverage data for very large functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214228
91177308-0d34-0410-b5e6-
96231b3b80d8