Yuri Gorshenin [Mon, 1 Sep 2014 10:24:04 +0000 (10:24 +0000)]
Revert "[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMemOperand()."
This reverts commit
895aa397038b8de86d83ac0997a70949a486e112.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216872
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 1 Sep 2014 10:09:18 +0000 (10:09 +0000)]
Fix a really bad miscompile introduced in r216865 - the else-if logic
chain became completely broken here as *all* intrinsic users ended up
being skipped, and the ones that seemed to be singled out were actually
the exact wrong set.
This is a great example of why long else-if chains can be easily
confusing. Switch the entire code to use early exits and early continues
to have simpler (and more importantly, correct) logic here, as well as
fixing the reversed logic for detecting and continuing on lifetime
intrinsics.
I've also significantly cleaned up the test case and added another test
case demonstrating an example where the optimization is not (trivially)
safe to perform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216871
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Mon, 1 Sep 2014 10:00:17 +0000 (10:00 +0000)]
Small refactor on VectorizerHint for deduplication
Previously, the hint mechanism relied on clean up passes to remove redundant
metadata, which still showed up if running opt at low levels of optimization.
That also has shown that multiple nodes of the same type, but with different
values could still coexist, even if temporary, and cause confusion if the
next pass got the wrong value.
This patch makes sure that, if metadata already exists in a loop, the hint
mechanism will never append a new node, but always replace the existing one.
It also enhances the algorithm to cope with more metadata types in the future
by just adding a new type, not a lot of code.
Re-applying again due to MSVC 2013 being minimum requirement, and this patch
having C++11 that MSVC 2012 didn't support.
Fixes PR20655.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216870
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuri Gorshenin [Mon, 1 Sep 2014 09:56:45 +0000 (09:56 +0000)]
[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMemOperand().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216869
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 1 Sep 2014 09:01:39 +0000 (09:01 +0000)]
Feed AA to the inliner and use AA->getModRefBehavior in AddAliasScopeMetadata
This feeds AA through the IFI structure into the inliner so that
AddAliasScopeMetadata can use AA->getModRefBehavior to figure out which
functions only access their arguments (instead of just hard-coding some
knowledge of memory intrinsics). Most of the information is only available from
BasicAA; this is important for preserving alias scoping information for
target-specific intrinsics when doing the noalias parameter attribute to
metadata conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216866
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 1 Sep 2014 06:03:11 +0000 (06:03 +0000)]
Ignore lifetime intrinsics in use list for MemCpyOptimizer. Patch by Luqman Aden, review by Hal Finkel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216865
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 1 Sep 2014 05:17:15 +0000 (05:17 +0000)]
Remove an errant outer loop that contains nothing but an inner loop over exactly the same elements. While no functionality is change intended (and hence there are no changes to tests), you don't want to skip this revision if bisecting for errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216864
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 1 Sep 2014 04:26:40 +0000 (04:26 +0000)]
Fix AddAliasScopeMetadata again - alias.scope must be a complete description
I thought that I had fixed this problem in r216818, but I did not do a very
good job. The underlying issue is that when we add alias.scope metadata we are
asserting that this metadata completely describes the aliasing relationships
within the current aliasing scope domain, and so in the context of translating
noalias argument attributes, the pointers must all be based on noalias
arguments (as underlying objects) and have no other kind of underlying object.
In r216818 excluding appropriate accesses from getting alias.scope metadata is
done by looking for underlying objects that are not identified function-local
objects -- but that's wrong because allocas, etc. are also function-local
objects and we need to explicitly check that all underlying objects are the
noalias arguments for which we're adding metadata aliasing scopes.
This fixes the underlying-object check for adding alias.scope metadata, and
does some refactoring of the related capture-checking eligibility logic (and
adds more comments; hopefully making everything a bit clearer).
Fixes self-hosting on x86_64 with -mllvm -enable-noalias-to-md-conversion (the
feature is still disabled by default).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216863
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 1 Sep 2014 03:47:25 +0000 (03:47 +0000)]
[MachineSink] Use the real post dominator tree
Summary:
Fixes a FIXME in MachineSinking. Instead of using the simple heuristics
in isPostDominatedBy, use the real MachinePostDominatorTree. The old
heuristics caused instructions to sink unnecessarily, and might create
register pressure.
Test Plan:
Added a NVPTX codegen test to verify that our change is in effect. It also
shows the unnecessary register pressure caused by over-sinking. Updated
affected tests in AArch64 and X86.
Reviewers: eliben, meheff, Jiangning
Reviewed By: Jiangning
Subscribers: jholewinski, aemerson, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D4814
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216862
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 21:26:22 +0000 (21:26 +0000)]
DebugInfo: Elide lexical scopes which only contain other (inline or lexical) scopes.
DW_TAG_lexical_scopes inform debuggers about the instruction range for
which a given variable (or imported declaration/module/etc) is valid. If
the scope doesn't itself contain any such entities, it's a waste of
space and should be omitted.
We were correctly doing this for entirely empty leaves, but not for
intermediate nodes.
Reduces total (not just debug sections) .o file size for a bootstrap
-gmlt LLVM by 22% and bootstrap -gmlt clang executable by 13%. The wins
for a full -g build will be less as a % (and in absolute terms), but
should still be substantial - with some of that win being fewer
relocations, thus more substantiall reducing link times than fewer bytes
alone would have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216861
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 31 Aug 2014 19:19:57 +0000 (19:19 +0000)]
Consider addrspaces in canLosslesslyBitCastTo()
Make this conservatively correct and report false for different
address spaces, which might require a nontrivial translation.
Based on the few uses of this, I don't think this currently
breaks anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216846
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 18:04:28 +0000 (18:04 +0000)]
DebugInfo: Move argument creation up into the caller that's unambiguously handling the subprogram scope (replacing a conditional with an assertion in the process)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216845
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 05:46:17 +0000 (05:46 +0000)]
Delay adding imported entity DIEs to the lexical scope, streamlining the check for "this scope has nothing in it"
This makes the emptiness of the scope with regards to variables and
nested scopes is the same as with regards to imported entities. Just
check if we had nothing at all before we build the node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216840
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 05:41:15 +0000 (05:41 +0000)]
Modify DwarfDebug::constructImportedEntityDIE to return rather than insert into the scope
Another step towards improving lexical_scope handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216839
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 05:32:06 +0000 (05:32 +0000)]
Refactor constructImportedEntityDIE(DwarfUnit, DIImportedEntity) to return a DIE rather than inserting it into a specified context.
First of many steps to improve lexical scope construction (to omit
trivial lexical scopes - those without any direct variables). To that
end it's easier not to create imported entities directly into the
lexical scope node, but to build them, then add them if necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216838
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 02:14:26 +0000 (02:14 +0000)]
Simplify expression using container's front() rather than begin()->
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216833
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 31 Aug 2014 01:33:41 +0000 (01:33 +0000)]
Add some negative (and positive) static_assert checks for ArrayRef-of-pointer conversions introduced in r216709
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216830
91177308-0d34-0410-b5e6-
96231b3b80d8
Josh Klontz [Sat, 30 Aug 2014 18:33:35 +0000 (18:33 +0000)]
[PATCH][Interpreter] Add missing FP intrinsic lowering.
Summary:
This extends the work done in [1], adding missing intrinsic lowering for floor, trunc, round and copysign.
[1] http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/199372
Test Plan: Extended `test/ExecutionEngine/Interpreter/intrinsics.ll` to test the additional missing intrinsics. All tests pass.
Reviewers: dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5120
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216827
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Sat, 30 Aug 2014 17:07:55 +0000 (17:07 +0000)]
Teach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream.
This allows streams that only use BLOCKINFO for debugging purposes to omit
the block entirely. As long as another stream is available with the correct
BLOCKINFO, the first stream can still be analyzed and dumped.
As part of this commit, BitstreamReader gets a move constructor and move
assignment operator, as well as a takeBlockInfo method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216826
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 30 Aug 2014 16:48:34 +0000 (16:48 +0000)]
Remove 'virtual' keyword from methods markedwith 'override' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216823
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 30 Aug 2014 16:48:22 +0000 (16:48 +0000)]
Use StringRef to avoid copies and simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216822
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 30 Aug 2014 16:48:19 +0000 (16:48 +0000)]
Add a test for converting ArrayRef<T *> to ArrayRef<const T *>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216821
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 30 Aug 2014 16:48:02 +0000 (16:48 +0000)]
Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216820
91177308-0d34-0410-b5e6-
96231b3b80d8
Brad Smith [Sat, 30 Aug 2014 14:52:34 +0000 (14:52 +0000)]
JIT support has been added awhile ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216819
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 30 Aug 2014 12:48:33 +0000 (12:48 +0000)]
Fix AddAliasScopeMetadata to not add scopes when deriving from unknown pointers
The previous implementation of AddAliasScopeMetadata, which adds noalias
metadata to preserve noalias parameter attribute information when inlining had
a flaw: it would add alias.scope metadata to accesses which might have been
derived from pointers other than noalias function parameters. This was
incorrect because even some access known not to alias with all noalias function
parameters could easily alias with an access derived from some other pointer.
Instead, when deriving from some unknown pointer, we cannot add alias.scope
metadata at all. This fixes a miscompile of the test-suite's tramp3d-v4.
Furthermore, we cannot add alias.scope to functions unless we know they
access only argument-derived pointers (currently, we know this only for
memory intrinsics).
Also, we fix a theoretical problem with using the NoCapture attribute to skip
the capture check. This is incorrect (as explained in the comment added), but
would not matter in any code generated by Clang because we get only inferred
nocapture attributes in Clang-generated IR.
This functionality is not yet enabled by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216818
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 30 Aug 2014 09:19:05 +0000 (09:19 +0000)]
InstCombine: Respect recursion depth in visitUDivOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216817
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 30 Aug 2014 06:18:20 +0000 (06:18 +0000)]
InstCombine: Try harder to combine icmp instructions
consider: (and (icmp X, Y), (and Z, (icmp A, B)))
It may be possible to combine (icmp X, Y) with (icmp A, B).
If we successfully combine, create an 'and' instruction with Z.
This fixes PR20814.
N.B. There is room for improvement after this change but I'm not
convinced it's worth chasing yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216814
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Sat, 30 Aug 2014 06:16:26 +0000 (06:16 +0000)]
Revert r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR."
I think this broke the build bot. Reverting it for now until I have time to take a closer look.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216813
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Callanan [Sat, 30 Aug 2014 02:30:02 +0000 (02:30 +0000)]
Fixed a build problem when there were headers
for a different LLVM present in the system header
lookup path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216812
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Sat, 30 Aug 2014 02:29:49 +0000 (02:29 +0000)]
Add missing const to StringRef.copy()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216811
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Sat, 30 Aug 2014 01:57:34 +0000 (01:57 +0000)]
Fix typo and formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216809
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Sat, 30 Aug 2014 00:20:14 +0000 (00:20 +0000)]
Object/llvm-objdump: allow dumping of mach-o exports trie
MachOObjectFile in lib/Object currently has no support for parsing the rebase,
binding, and export information from the LC_DYLD_INFO load command in final
linked mach-o images. This patch adds support for parsing the exports trie data
structure. It also adds an option to llvm-objdump to dump that export info.
I did the exports parsing first because it is the hardest. The information is
encoded in a trie structure, but the standard ObjectFile way to inspect content
is through iterators. So I needed to make an iterator that would do a
non-recursive walk through the trie and maintain the concatenation of edges
needed for the current string prefix.
I plan to add similar support in MachOObjectFile and llvm-objdump to
parse/display the rebasing and binding info too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216808
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Fri, 29 Aug 2014 23:48:09 +0000 (23:48 +0000)]
[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR.
Select the correct register class for the various instructions that are
generated when combining instructions and constrain the registers to the
appropriate register class.
This fixes rdar://problem/
18183707.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216805
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Fri, 29 Aug 2014 23:48:06 +0000 (23:48 +0000)]
[FastISel][AArch64] Use the correct register class for branches.
Also constrain the register class for branches.
This fixes rdar://problem/
18181496.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216804
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Fri, 29 Aug 2014 23:48:03 +0000 (23:48 +0000)]
[MachineSinking] Clear kill flag of all operands at all their uses.
When sinking an instruction it might be moved past the original last use of one
of its operands. This last use has the kill flag set and the verifier will
obviously complain about this.
Before Machine Sinking (AArch64):
%vreg3<def> = ASRVXr %vreg1, %vreg2<kill>
%XZR<def> = SUBSXrs %vreg4, %vreg1<kill>, 160, %NZCV<imp-def>
...
After Machine Sinking:
%XZR<def> = SUBSXrs %vreg4, %vreg1<kill>, 160, %NZCV<imp-def>
...
%vreg3<def> = ASRVXr %vreg1, %vreg2<kill>
This fix clears all the kill flags in all instruction that use the same operands
as the instruction that is being sunk.
This fixes rdar://problem/
18180996.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216803
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 29 Aug 2014 23:17:47 +0000 (23:17 +0000)]
[MCJIT] Move endian-aware read/writes from RuntimeDyldMachO into
RuntimeDyldImpl.
These are platform independent, and moving them to the base class allows
RuntimeDyldChecker to use them too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216801
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 29 Aug 2014 22:44:07 +0000 (22:44 +0000)]
Debug info: Add a new explicit DIDescriptor flag for the "public" access
specifier and change the default behavior to only emit the
DW_AT_accessibility(public) attribute when the isPublic() is explicitly
set.
rdar://problem/
18154959
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216799
91177308-0d34-0410-b5e6-
96231b3b80d8
Jean-Luc Duprat [Fri, 29 Aug 2014 22:43:30 +0000 (22:43 +0000)]
Comment only: Annotate loop as per mailing list discussion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216798
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 29 Aug 2014 22:34:28 +0000 (22:34 +0000)]
Make isValidMCLOHType take unsigned instead of enum to avoid loading invalid enum values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216797
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 29 Aug 2014 22:30:52 +0000 (22:30 +0000)]
Next bit of support for llvm-objdump’s -private-headers for Mach-O files.
This adds the printing of the LC_SEGMENT load command and sections,
LC_SYMTAB and LC_DYSYMTAB load commands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216795
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 22:14:26 +0000 (22:14 +0000)]
AArch64: Silence -Wabsolute-value warning with std::abs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216794
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 22:12:08 +0000 (22:12 +0000)]
Speculative build fix for const, gcc, and ArrayRef overloads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216793
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 29 Aug 2014 22:10:52 +0000 (22:10 +0000)]
Revert accidentally committed patches r216787-r216789
Rushed when I realized I hadn't committed the FreeDeleter for a clang
change I'd committed, and didn't check that I had things lying around in
my client.
Apologies for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216792
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 29 Aug 2014 22:05:31 +0000 (22:05 +0000)]
Add a trivial functor for use with unique_ptrs managing memory that needs to be freed rather than deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216790
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 29 Aug 2014 22:05:29 +0000 (22:05 +0000)]
Omit DW_AT_artificial, DW_AT_external, and similar attributes under -gmlt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216789
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 29 Aug 2014 22:05:27 +0000 (22:05 +0000)]
Omit dwarf::DW_AT_frame_base under -gmlt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216788
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 29 Aug 2014 22:05:26 +0000 (22:05 +0000)]
Stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216787
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Fri, 29 Aug 2014 21:53:01 +0000 (21:53 +0000)]
Fix typos in comments, NFC
Summary: Just fixing comments, no functional change.
Test Plan: N/A
Reviewers: jfb
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D5130
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216784
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 21:42:21 +0000 (21:42 +0000)]
Add a const and munge some comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216781
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 21:42:08 +0000 (21:42 +0000)]
musttail: Forward regparms of variadic functions on x86_64
Summary:
If a variadic function body contains a musttail call, then we copy all
of the remaining register parameters into virtual registers in the
function prologue. We track the virtual registers through the function
body, and add them as additional registers to pass to the call. Because
this is all done in virtual registers, the register allocator usually
gives us good code. If the function does a call, however, it will have
to spill and reload all argument registers (ew).
Forwarding regparms on x86_32 is not implemented because most compilers
don't support varargs in 32-bit with regparms.
Reviewers: majnemer
Subscribers: aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D5060
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216780
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 21:25:28 +0000 (21:25 +0000)]
Verifier: Don't reject varargs callee cleanup functions
We've rejected these kinds of functions since r28405 in 2006 because
it's impossible to lower the return of a callee cleanup varargs
function. However there are lots of legal ways to leave such a function
without returning, such as aborting. Today we can leave a function with
a musttail call to another function with the correct prototype, and
everything works out.
I'm removing the verifier check declaring that a normal return from such
a function is UB.
Reviewed By: nlewycky
Differential Revision: http://reviews.llvm.org/D5059
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216779
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Fri, 29 Aug 2014 21:00:22 +0000 (21:00 +0000)]
Remove spurious mask operations from AArch64 add->compares on 16 and 8 bit values
This patch checks for DAG patterns that are an add or a sub followed by a
compare on 16 and 8 bit inputs. Since AArch64 does not support those types
natively they are legalized into 32 bit values, which means that mask operations
are inserted into the DAG to emulate overflow behaviour. In many cases those
masks do not change the result of the processing and just introduce a dependent
operation, often in the middle of a hot loop.
This patch detects the relevent DAG patterns and then tests to see if the
transforms are equivalent with and without the mask, removing the mask if
possible. The exact mechanism of this patch was discusses in
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074444.html
There is a reasonably good chance there are missed oppurtunities due to similiar
(but not identical) DAG patterns that could be funneled into this test, adding
them should be simple if we see test cases.
Tests included.
rdar://
13754426
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216776
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 Aug 2014 20:50:31 +0000 (20:50 +0000)]
X86: Fix conflict over ESI between base register and rep;movsl
The new solution is to not use this lowering if there are any dynamic
allocas in the current function. We know up front if there are dynamic
allocas, but we don't know if we'll need to create stack temporaries
with large alignment during lowering. Conservatively assume that we will
need such temporaries.
Reviewed By: hans
Differential Revision: http://reviews.llvm.org/D5128
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216775
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Aug 2014 20:35:00 +0000 (20:35 +0000)]
another typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216774
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Aug 2014 20:34:17 +0000 (20:34 +0000)]
typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216773
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Fri, 29 Aug 2014 20:32:58 +0000 (20:32 +0000)]
Relax the constraint more in MemoryDependencyAnalysis.cpp
Even loads/stores that have a stronger ordering than monotonic can be safe.
The rule is no release-acquire pair on the path from the QueryInst, assuming that
the QueryInst is not atomic itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216771
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Fri, 29 Aug 2014 20:19:23 +0000 (20:19 +0000)]
[X86] Refactor X86ISelDAGToDAG::SelectAtomicLoadArith - NFC
Summary:
Mostly renaming the (not very explicit) variables Tmp0, .. Tmp4, and grouping
related statements together, along with a few lines of comments for the
surprising parts.
No functional change intended.
Test Plan: make check-all
Reviewers: jfb
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5088
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216768
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Fri, 29 Aug 2014 19:55:55 +0000 (19:55 +0000)]
Add missing mach-o EXPORT_SYMBOL_FLAG_KIND_ABSOLUTE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216759
91177308-0d34-0410-b5e6-
96231b3b80d8
Jean-Luc Duprat [Fri, 29 Aug 2014 19:41:04 +0000 (19:41 +0000)]
Tablegen fixes for new syntax when initializing bits from variables.
Followup to r215086.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216757
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Fri, 29 Aug 2014 17:58:16 +0000 (17:58 +0000)]
[FastISel][AArch64] Fix an incorrect kill flag due to a bug in SelectTrunc.
When we select a trunc instruction we don't emit any code if the type is already
i32 or smaller. This is because the instruction that uses the truncated value
will deal with it.
This behavior can incorrectly transfer a kill flag, which was meant for the
result of the truncate, onto the source register.
%2 = trunc i32 %1 to i16
... = ... %2 -> ... = ... vreg1 <kill>
... = ... %1 ... = ... vreg1
This commit fixes this by emitting a COPY instruction, so that the result and
source register are distinct virtual registers.
This fixes rdar://problem/
18178188.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216750
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Fri, 29 Aug 2014 17:19:00 +0000 (17:19 +0000)]
[ARM] Add Thumb-2 code size optimization test for ASR (register).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216746
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Fri, 29 Aug 2014 17:02:28 +0000 (17:02 +0000)]
[ARM] Add Thumb-2 code size optimization test for ASR (immediate).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216744
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 29 Aug 2014 16:33:41 +0000 (16:33 +0000)]
Fix a typo in AddAliasScopeMetadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216741
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 29 Aug 2014 16:01:17 +0000 (16:01 +0000)]
Make fabs safe to speculatively execute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216736
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 29 Aug 2014 16:01:14 +0000 (16:01 +0000)]
R600/SI: Use mad for fsub + fmul
We can use a negate source modifier to match
this for fsub.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216735
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 29 Aug 2014 15:34:58 +0000 (15:34 +0000)]
AArch64: only try to get operand of a known node.
A bug in r216725 meant we tried to discover the type of a SETCC before
confirming the node actually was a SETCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216734
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 Aug 2014 15:32:15 +0000 (15:32 +0000)]
Remove unnecessary regex in test pattern per dblaikie suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216733
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Aug 2014 15:32:09 +0000 (15:32 +0000)]
typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216732
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 Aug 2014 15:30:20 +0000 (15:30 +0000)]
[NVPTX] Make the alignment an explicit argument to ldu/ldg
Summary:
Instead of specifying the alignment as metadata which may be destroyed by
transformation passes, make the alignment the second argument to ldu/ldg
intrinsic calls.
Test Plan:
ldu-ldg.ll
ldu-i8.ll
ldu-reg-plus-offset.ll
Reviewers: eliben, meheff, jholewinski
Reviewed By: meheff, jholewinski
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D5093
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216731
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Fri, 29 Aug 2014 15:13:35 +0000 (15:13 +0000)]
[ARM] Make Thumb-2 code size optimization test more strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216729
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Fri, 29 Aug 2014 15:04:40 +0000 (15:04 +0000)]
[ARM] Add a first test for the Thumb-2 code size optimization pass.
While working on a Thumb-2 code size optimization I just realized that we don't have any regression tests for it.
So here's a first test case, I plan to increase the coverage over time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216728
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 29 Aug 2014 13:05:18 +0000 (13:05 +0000)]
AArch64: skip select/setcc combine in complex case.
In an llvm-stress generated test, we were trying to create a v0iN type and
asserting when that failed. This case could probably be handled by the
function, but not without added complexity and the situation it arises in is
sufficiently odd that there's probably no benefit anyway.
Should fix PR20775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216725
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Fri, 29 Aug 2014 09:54:11 +0000 (09:54 +0000)]
[AArch64] FPLoadBalancing: move ownership of the chain to its current accumulator register
and forget about the previously used accumulator.
Coming up with a simple testcase is not easy, as this highly depends on
what the register allocator is doing: this issue showed up while working
with the PBQP allocator, which produced a different allocation scheme.
A testcase would need to come up with chain starting in D[0-7], then
moving to D[8-15], followed by a call to a function whose regmask
clobbers the starting accumulator in D[0-7], then another use of the chain.
Fixed some formatting, added some invariant checks while there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216721
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 Aug 2014 09:00:26 +0000 (09:00 +0000)]
Use DwarfDebug::attachLowHighPC for the compilation unit DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216719
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Fri, 29 Aug 2014 08:46:04 +0000 (08:46 +0000)]
[SKX] Enable lowering of integer CMP operations.
Added new types to Legalizer.
Fixed getSetCCResultType function
Added lowering tests.
Reviewed by Elena Demikhovsky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216717
91177308-0d34-0410-b5e6-
96231b3b80d8
Job Noorman [Fri, 29 Aug 2014 08:23:53 +0000 (08:23 +0000)]
Do not assume the value passed to memset is an i32.
The code in SelectionDAG::getMemset for some reason assumes the value passed to
memset is an i32. This breaks the generated code for targets that only have
registers smaller than 32 bits because the value might get split into multiple
registers by the calling convention. See the test for the MSP430 target included
in the patch for an example.
This patch ensures that nothing is assumed about the type of the value. Instead,
the type is taken from the selected overload of the llvm.memset intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216716
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 29 Aug 2014 06:01:43 +0000 (06:01 +0000)]
Add conversion constructor to convert ArrayRef<T*> to ArrayRef<const T*>. Reviewed with Chandler and David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216709
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Fri, 29 Aug 2014 01:31:42 +0000 (01:31 +0000)]
[AArch64] Fix some failures exposed by value type v4f16 and v8f16.
1) Add some missing bitcast patterns for v8f16.
2) Add type promotion for operand of ld/st operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216706
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 29 Aug 2014 01:05:16 +0000 (01:05 +0000)]
Cleaning up static initializers in Signals.inc
Reviewed by: Chandlerc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216704
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 29 Aug 2014 01:05:12 +0000 (01:05 +0000)]
Cleaning up static initializers in TimeValue.
Code reviewed by Chandlerc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216703
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 29 Aug 2014 00:50:36 +0000 (00:50 +0000)]
Introduce -DLLVM_USE_SANITIZER=Undefined CMake option to build UBSan-ified version of LLVM/Clang.
I've fixed most of the simple bugs and currently "check-llvm" test suite
has 26 failures, and "check-clang" suite has 5 failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216701
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Fri, 29 Aug 2014 00:19:21 +0000 (00:19 +0000)]
[FastISel][AArch64] Don't fold instructions that are not in the same basic block.
This fix checks first if the instruction to be folded (e.g. sign-/zero-extend,
or shift) is in the same machine basic block as the instruction we are folding
into.
Not doing so can result in incorrect code, because the value might not be
live-out of the basic block, where the value is defined.
This fixes rdar://problem/
18169495.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216700
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 29 Aug 2014 00:06:43 +0000 (00:06 +0000)]
Revert two GEP-related InstCombine commits
This reverts commit r216523 and r216598; people have reported
regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216698
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 Aug 2014 22:42:00 +0000 (22:42 +0000)]
Don't promote byval pointer arguments when padding matters
Don't promote byval pointer arguments when when their size in bits is
not equal to their alloc size in bits. This can happen for x86_fp80,
where the size in bits is 80 but the alloca size in bits in 128.
Promoting these types can break passing unions of x86_fp80s and other
types.
Patch by Thomas Jablin!
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D5057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216693
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 28 Aug 2014 22:08:28 +0000 (22:08 +0000)]
AArch64: More correctly constrain target vector extend lowering.
The AArch64 target lowering for [zs]ext of vectors is set up to handle
input simple types and expects the generic SDag path to do something reasonable
with anything that's not a simple type. The code, however, was only
checking that the result type was a simple type and assuming that
implied that the source type would also be a simple type. That's not a
valid assumption, as operations like "zext <1 x i1> %0 to <1 x i32>"
demonstrate. The fix is to simply explicitly validate the source type
as well as the result type.
PR20791
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216689
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Aug 2014 21:51:37 +0000 (21:51 +0000)]
Move FNEG next to FABS and make them more similar, so it's easier that they can be refactored. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216688
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 Aug 2014 20:13:31 +0000 (20:13 +0000)]
On MachO, don't put non-private constants in mergeable sections.
On MachO, putting a symbol that doesn't start with a 'L' or 'l' in one of the
__TEXT,__literal* sections prevents the linker from merging the context of the
section.
Since private GVs are the ones the get mangled to start with 'L' or 'l', we now
only put those on the __TEXT,__literal* sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216682
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 28 Aug 2014 19:09:29 +0000 (19:09 +0000)]
Constify MCSymbol* parameters to DwarfDebug::attachLowHighPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216681
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Aug 2014 18:59:22 +0000 (18:59 +0000)]
Fix a logic bug in x86 vector codegen: sext (zext (x) ) != sext (x) (PR20472).
Remove a block of code from LowerSIGN_EXTEND_INREG() that was added with:
http://llvm.org/viewvc/llvm-project?view=revision&revision=177421
And caused:
http://llvm.org/bugs/show_bug.cgi?id=20472 (more analysis here)
http://llvm.org/bugs/show_bug.cgi?id=18054
The testcases confirm that we (1) don't remove a zext op that is necessary and (2) generate
a pmovz instead of punpck if SSE4.1 is available. Although pmovz is 1 byte longer, it allows
folding of the load, and so saves 3 bytes overall.
Differential Revision: http://reviews.llvm.org/D4909
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216679
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 28 Aug 2014 17:49:58 +0000 (17:49 +0000)]
Do not introduce new shuffle patterns after operation legalization if SHUFFLE_VECTOR
was marked custom. The target independent DAG combine has no way to know if
the shuffles it is introducing are ones that the target could support or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216678
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Aug 2014 16:29:51 +0000 (16:29 +0000)]
Janitorial services: "Don’t duplicate function or class name at the beginning of the comment."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216674
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Aug 2014 16:01:50 +0000 (16:01 +0000)]
Remove local TLI vars that are just duplicates of the class var. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216673
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Aug 2014 15:53:16 +0000 (15:53 +0000)]
Use local vars to improve readability. No functional change.
Completes what was started in r216611 and r216623.
Used const refs instead of pointers; not sure if one is preferable to the other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216672
91177308-0d34-0410-b5e6-
96231b3b80d8
Sid Manning [Thu, 28 Aug 2014 14:16:32 +0000 (14:16 +0000)]
Minor spelling correction.
Reviewers: adasgupt, jverma, sidneym
Differential Revision: http://reviews.llvm.org/D5025
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216667
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 28 Aug 2014 13:23:26 +0000 (13:23 +0000)]
Silence a -Wsign-compare warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216666
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Thu, 28 Aug 2014 10:15:47 +0000 (10:15 +0000)]
[PBQP] Only output debug information when requested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216660
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 Aug 2014 10:08:37 +0000 (10:08 +0000)]
InstCombine: Remove redundant combines
InstSimplify already handles icmp (X+Y), X (and things like it)
appropriately. The first thing that InstCombine does is run
InstSimplify on the instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216659
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Thu, 28 Aug 2014 07:04:02 +0000 (07:04 +0000)]
Fix: SLPVectorizer tried to move an instruction which was replaced by a vector instruction.
For a detailed description of the problem see the comment in the test file.
The problematic moveBefore() calls are not required anymore because the new
scheduling algorithm ensures a correct ordering anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216656
91177308-0d34-0410-b5e6-
96231b3b80d8
David Xu [Thu, 28 Aug 2014 04:59:53 +0000 (04:59 +0000)]
Generate CMN when comparing a short int with minus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216651
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Hibbits [Thu, 28 Aug 2014 04:40:55 +0000 (04:40 +0000)]
Test commit. Fix whitespace from a previous patch of mine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216650
91177308-0d34-0410-b5e6-
96231b3b80d8