134148 Commits

Author SHA1 Message Date
David Majnemer
87d5e72f1d [APInt] Don't shift into the sign bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:15:36 +00:00
Rafael Espindola
ab8ffadc13 Add support for musl-libc on ARM Linux.
Patch by Lei Zhang!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:14:33 +00:00
Chris Bieneman
5b01931d4c [MachO] Fixing copy-paste error from r273719
Thanks Kevin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:06:52 +00:00
Michael Kuperstein
783d353e52 Add missing dependency to LLVMPasses
Passes should depend on CodeGen, as that contains some IR-to-IR passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:05:41 +00:00
George Burgess IV
122fe57ae3 [MemorySSA] Move code around a bit. NFC.
This patch moves MSSA's caching walker into MemorySSA, and moves the
actual definition of MSSA's caching walker out of MemorySSA.h. This is
done in preparation for the new walker, which should be out for review
soonish.

Also, this patch removes a field from UpwardsMemoryQuery and has a few
lines of diff from clang-format'ing MemorySSA.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:02:12 +00:00
David Majnemer
536b1bc60e [APInt] Don't shift into the sign bit
This fixes PR28294.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:51:47 +00:00
Chris Bieneman
e92acf1526 [obj2yaml] [yaml2obj] Support for MachO Universal binaries
This patch adds round-trip support for MachO Universal binaries to obj2yaml and yaml2obj. Universal binaries have a header and list of architecture structures, followed by a the individual object files at specified offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:42:28 +00:00
Ahmed Bougacha
26f3c3b0c4 [ARM] Remove dead SDNodes. NFC.
The opcodes are used, but only by DAG->DAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:38:00 +00:00
Ahmed Bougacha
5e751c7749 [X86] Remove dead ISD opcodes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:37:55 +00:00
Sanjay Patel
1fdd592ebc [InstCombine] use m_APInt; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:36:34 +00:00
Michael Kuperstein
f3f8fc6a20 [PM] Port PreISelIntrinsicLowering to the new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:13:42 +00:00
David Majnemer
7748b9996e SimplifyInstruction does not imply DCE
We cannot remove an instruction with no uses just because
SimplifyInstruction succeeds.  It may have side effects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 19:34:46 +00:00
David Majnemer
82c356cae4 [CodeView] Healthy paranoia around strings
Make sure strings don't get too big for a record, truncate them if
need-be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 19:34:41 +00:00
Evandro Menezes
28ea97622f [AArch64] Adjust the model for the vector by element FP multiplies on Exynos M1. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:58:54 +00:00
Peter Collingbourne
2f7c4b22bb Revert r273545, "[IfConversion] Bugfix: Don't use undef flag while adding use operands."
as it caused PR28295.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:57:29 +00:00
Sanjay Patel
cc2e81eaf2 [InstCombine] refactor optional bitcasting in matchSelectFromAndOr() into one code path (NFCI)
Tests to verify that the commuted variants are all exercised were added with:
http://reviews.llvm.org/rL273702


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:55:27 +00:00
Rafael Espindola
fddccef6cb Use shouldAssumeDSOLocal in isOffsetFoldingLegal.
This makes it slightly more powerful for dynamic-no-pic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273704 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:48:36 +00:00
Reid Kleckner
c0b6cd2c10 Revert "InstCombine rule to fold trunc when value available"
This reverts commit r273608.

Broke building code with sanitizers, where apparently these kinds of
loads, casts, and truncations are common:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24502
http://crbug.com/623099

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:42:58 +00:00
Sanjay Patel
efe34a4c9d [InstCombine] consolidate commutation variants of matchSelectFromAndOr() in one place; NFCI
By putting all the possible commutations together, we simplify the code.
Note that this is NFCI, but I'm adding tests that actually exercise each
commutation pattern because we don't have this anywhere else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:26:02 +00:00
Kevin Enderby
317de7ce5b Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow
a good error message to be produced.

This is nearly the last libObject interface that used ErrorOr and the last one
that appears in llvm/include/llvm/Object/MachO.h .  For Mach-O objects this is
just a clean up because it’s version of getSymbolAddress() can’t return an
error.

I will leave it to the experts on COFF and ELF to actually add meaning full
error messages in their tests if they wish.  And also leave it to these experts
to change the last two ErrorOr interfaces in llvm/include/llvm/Object/ObjectFile.h
for createCOFFObjectFile() and createELFObjectFile() if they wish.

Since there are no test cases for COFF and ELF error cases with respect to
getSymbolAddress() in the test suite this is no functional change (NFC).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:24:42 +00:00
Kyle Butt
546c8eba34 Codegen: Fix broken assumption in Tail Merge.
Tail merge was making the assumption that a layout successor or
predecessor was always a cfg successor/predecessor. Remove that
assumption. Changes to tests are necessary because the errant cfg edges
were preventing optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:16:36 +00:00
Rafael Espindola
d4e43baeb0 Use FileCheck. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:04:39 +00:00
Reid Kleckner
20c960971f [codeview] Emit parameter variables in the right order
Clang emits them in reverse order to conform to the ABI, which requires
left-to-right destruction. As a result, the order doesn't fall out
naturally, and we have to sort things out in the backend.

Fixes PR28213

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 17:55:40 +00:00
Peter Collingbourne
43c5139fd2 Linker: Copy metadata when linking declarations.
Differential Revision: http://reviews.llvm.org/D21624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 17:42:21 +00:00
Reid Kleckner
b892430f09 [codeview] Use one byte for S_FRAMECOOKIE CookieKind and add flags byte
We bailed out while printing codeview for an MSVC compiled
SemaExprCXX.cpp that used this record. The MS reference headers look
incorrect here, which is probably why we had this bug. They use a 32-bit
enum as the field type, but the actual record appears to use one byte
for the cookie kind followed by a flags byte.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 17:23:49 +00:00
Chad Rosier
7ba5baa40a [MDT] Always verify machine dominfo if expensive checking is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 17:15:04 +00:00
Reid Kleckner
f327997798 [codeview] Emit base class information from DW_TAG_inheritance nodes
There are two remaining issues here:
1. No vbptr information
2. Need to mention indirect virtual bases

Getting indirect virtual bases is just a matter of adding an "indirect"
flag, emitting them in the frontend, and ignoring them when appropriate
for DWARF.

All virtual bases use the same artificial vbptr field, so I think the
vbptr offset will be best represented by an implicit __vbptr$ClassName
member similar to our existing __vptr$ member.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 16:24:24 +00:00
Matthew Simpson
1d3ab3afe1 [LV] Preserve order of dependences in interleaved accesses analysis
The interleaved access analysis currently assumes that the inserted run-time
pointer aliasing checks ensure the absence of dependences that would prevent
its instruction reordering. However, this is not the case.

Issues can arise from how code generation is performed for interleaved groups.
For a load group, all loads in the group are essentially moved to the location
of the first load in program order, and for a store group, all stores in the
group are moved to the location of the last store. For groups having members
involved in a dependence relation with any other instruction in the loop, this
reordering can violate the dependence.

This patch teaches the interleaved access analysis how to avoid breaking such
dependences, and should fix PR27626.

An assumption of the original analysis was that the accesses had been collected
in "program order". The analysis was then simplified by visiting the accesses
bottom-up. However, this ordering was never guaranteed for anything other than
single basic block loops. Thus, this patch also enforces the desired ordering.

Reference: https://llvm.org/bugs/show_bug.cgi?id=27626
Differential Revision: http://reviews.llvm.org/D19984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 15:33:25 +00:00
Artur Pilipenko
140d9e6906 Remangle intrinsics names when types are renamed
This is a resubmittion of previously reverted rL273568.

This is a fix for the problem mentioned in "LTO and intrinsics mangling" llvm-dev mail thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098387.html

Reviewers: mehdi_amini, reames

Differential Revision: http://reviews.llvm.org/D19373


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 15:10:29 +00:00
Artur Pilipenko
2630656dc9 NFC. Move verifyIntrinsicIsVarArg from verifier to Intrinsic::matchIntrinsicVarArg since it will be reused for intrinsic remangling code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 14:47:27 +00:00
Saleem Abdulrasool
8324138899 ExecutionEngine: silence unused value warning
The Value is only used in debug or asserts builds.  Just cast to void to silence
an unused variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 14:31:09 +00:00
Saleem Abdulrasool
7fb006603a ExecutionEngine: add preliminary support for COFF ARM
This adds rudimentary support for COFF ARM to the dynamic loader for the
exeuction engine.  This can be used by lldb to JIT code into a COFF ARM
environment.  This lays the foundation for the loader, though a few of the
relocation types are yet unhandled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 14:11:44 +00:00
Rafael Espindola
c0b76e3114 Make sure Format is always initialized.
Should fix the msan bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 13:47:29 +00:00
Chad Rosier
238d855bdc [MachineDominatorTree] Add a MDT verifier.
Differential Revision: http://reviews.llvm.org/D21657

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 13:32:22 +00:00
Rafael Espindola
7758422e2a Use existing predicate. NFC.
This doesn't handle ELF, but neither did the previous code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 13:28:26 +00:00
Rafael Espindola
fa5b3f7e55 Merge two identical if branches. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 13:08:06 +00:00
Rafael Espindola
da1fb5d832 Merge two identical if branches. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273673 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 13:05:20 +00:00
Rafael Espindola
ce19c3558e clang-format a region. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 12:58:25 +00:00
Anna Thomas
6d0a0a4627 [LICM] Avoid repeating expensive call while promoting loads. NFC
Summary:
We can avoid repeating the check `isGuaranteedToExecute` when it's already called once while checking if the alignment can be widened for the load/store being hoisted.

The function is invariant for the same instruction `UI` in `isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo);`

Reviewers: hfinkel, eli.friedman

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 12:38:45 +00:00
Hubert Tong
29f4c94251 Revert r273664
Revert change until build issues with MSVC can be resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273670 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 12:25:15 +00:00
Daniel Sanders
f333491832 [mips] Use --check-prefixes where appropriate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273669 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 12:23:17 +00:00
Hubert Tong
84a2040038 Add FixedSizeStorage to TrailingObjects; NFC
Summary: This change introduces two types, `FixedSizeStorage` and `FixedSizeStorageOwner`, which can be used to provide stack-allocated objects with trailing objects.

Reviewers: rsmith, faisalv, aaron.ballman

Subscribers: llvm-commits, cfe-commits, nwilson

Differential Revision: http://reviews.llvm.org/D19770

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 11:34:16 +00:00
Simon Dardis
111ec25a8e Revert "Revert "[misched] Extend scheduler to handle unsupported features""
This reverts commit r273565.

This was an over-eager revert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 08:43:27 +00:00
Matt Arsenault
11c2d4bf28 AMDGPU: Add stub custom CodeGenPrepare pass
This will do various things including ones
CodeGenPrepare does, but with knowledge of uniform
values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 07:07:55 +00:00
George Burgess IV
a606472116 Remove hack introduced by r273641.
Hopefully the buildbots have had enough time to pick this up by now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 06:58:15 +00:00
Matt Arsenault
8b2f86f045 AMDGPU: Un-xfail and add tests
Un XFAIL a few tests plus a few more I had lying around
in my tree, which seem to all work now but I don't see tests
that quite test the same things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 06:58:01 +00:00
Matt Arsenault
9af2418e41 AMDGPU: Remove disable-irstructurizer subtarget feature
The only real reason to use it is for testing, so replace
it with a command line option instead of a potentially function
dependent feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 06:30:22 +00:00
Matt Arsenault
759ed7e410 AMDGPU: Cleanup subtarget handling.
Split AMDGPUSubtarget into amdgcn/r600 specific subclasses.
This removes most of the static_casting of the basic codegen
classes everywhere, and tries to restrict the features
visible on the wrong target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 06:30:11 +00:00
David Majnemer
8970c8886c Use the same underlying type for bitfields
MSVC allocates fresh storage for consecutive bitfields with different
underlying types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 04:05:25 +00:00
David Majnemer
30ef1b33fa Switch more loops to be range-based
This makes the code a little more concise, no functional change is
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 04:05:21 +00:00