Commit Graph

147366 Commits

Author SHA1 Message Date
Daniel Berlin
b0c8c6a0ef MemorySSA: Kill the WalkTargetCache now that we have getBlockDefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 08:59:45 +00:00
Craig Topper
ea476cb4cb [APInt] Implement operator! using operator==(uint64_t). NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299293 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 06:50:00 +00:00
Craig Topper
fa958b2284 [APInt] Remove the mul/urem/srem/udiv/sdiv functions from the APIntOps namespace. Replace the few usages with calls to the class methods. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 05:08:57 +00:00
Craig Topper
0c554b7eb1 [DAGCombiner] Fix fold (or (shuf A, V_0, MA), (shuf B, V_0, MB)) -> (shuf A, B, Mask) to explicitly ensure that only one of the inputs of each shuffle is a zero vector.
This can only happen when we have a mix of zero and undef elements and the two vectors have a different arrangement of zeros/undefs. The shuffle should eventually be constant folded to all zeros.

Fixes PR32484.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 04:26:20 +00:00
Quentin Colombet
2a400a79a2 Revert "Feature generic option to setup start/stop-after/before"
This reverts commit r299282.

Didn't intend to commit this :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:26:24 +00:00
Quentin Colombet
b6fca8cdd3 Revert "Localizer fun"
This reverts commit r299283.

Didn't intend to commit this :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299287 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:26:21 +00:00
Quentin Colombet
1da12ea840 Revert "Instrument SDISel C++ patterns"
This reverts commit r299284.

Didn't intend to commit this :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:26:17 +00:00
Quentin Colombet
209e8f27d2 [RegBankSelect] Support REG_SEQUENCE for generic mapping
REG_SEQUENCE falls into the same category as COPY for operands mapping:
- They don't have MCInstrDesc with register constraints
- The input variable could use whatever register classes
- It is possible to have register class already assigned to the operands

In particular, given REG_SEQUENCE are always target specific because of
the subreg indices. Those indices must apply to the register class of
the definition of the REG_SEQUENCE and therefore, the target must set a
register class to that definition. As a result, the generic code can
always use that register class to derive a valid mapping for a
REG_SEQUENCE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:26:14 +00:00
Quentin Colombet
9ca9c4340d Instrument SDISel C++ patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:21:32 +00:00
Quentin Colombet
3bae06e77e Localizer fun
WIP

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:21:28 +00:00
Quentin Colombet
79114cd2fa Feature generic option to setup start/stop-after/before
This patch refactors the code used in llc such that all the users of the
addPassesToEmitFile API have access to a homogeneous way of handling
start/stop-after/before options right out of the box.

Previously each user would have needed to duplicate this logic and set
up its own options.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 01:21:24 +00:00
Peter Collingbourne
61a230e3a0 Fix a test to check assembly output instead of bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299279 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 23:22:19 +00:00
Eric Christopher
8d057d4705 Reduce the number of times we query the subtarget for the same information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 23:12:27 +00:00
Eric Christopher
dae6ed5d29 Small cleanup to remove extraneous cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 23:12:24 +00:00
Konstantin Zhuravlyov
e41b522145 AMDGPU/llvm-readobj: Rename RuntimeMDNoteType -> CodeObjectMetadataNoteType to
match the new metadata. NFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 22:36:39 +00:00
Craig Topper
a9c17af0f6 [APInt] Fix bugs in isShiftedMask to match behavior of the similar function in MathExtras.h
This removes a parameter from the routine that was responsible for a lot of the issue. It was a bit count that had to be set to the BitWidth of the APInt and would get passed to getLowBitsSet. This guaranteed the call to getLowBitsSet would create an all ones value. This was then compared to (V | (V-1)). So the only shifted masks we detected had to have the MSB set.

The one in tree user is a transform in InstCombine that never fires due to earlier transforms covering the case better. I've submitted a patch to remove it completely, but for now I've just adapted it to the new interface for isShiftedMask.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 22:23:42 +00:00
Konstantin Zhuravlyov
5f15d53c5c [AMDGPU] Fix typo in test filename. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 22:14:54 +00:00
Derek Schuff
9120fd7904 Add virtual destructor to WasmYAML::Section or avoid memory leak
Tested locally with -DLLVM_USE_SANITIZER=Address

Differential Revision: https://reviews.llvm.org/D31551

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 22:14:14 +00:00
Bob Haarman
7afeaaf4b7 LTO: call getRealLinkageName on IRNames before feeding to getGUID
Summary: GlobalValue has two getGUID methods: an instance method and a static method. The static method takes a string, which is expected to be what GlobalValue::getRealLinkageName() would return. In LTO.cpp, we were not doing this consistently, sometimes passing an IR name instead. This change makes it so that we call getRealLinkageName() first, making the static getGUID return value consistent with the instance method. Without this change, compiling FileCheck with ThinLTO on Windows fails with numerous undefined symbol errors. With the change, it builds successfully.

Reviewers: pcc, rnk

Reviewed By: pcc

Subscribers: tejohnson, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D31444


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:56:30 +00:00
Craig Topper
a71015bc01 [InstCombine] When adding an Instruction and its Users to the worklist at the same time, make sure we put the Users in first. Then put in the instruction.
This way we ensure we immediately revisit the instruction and do any additional optimizations before visiting the users. Otherwise we might visit the users, then the instruction, then users again, then instruction again.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299267 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:35:30 +00:00
Sanjay Patel
e44ee41b80 [DAGCombiner] refactor and/or-of-setcc to get rid of duplicated code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299266 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:30:50 +00:00
Reid Kleckner
bf7a949a31 Fix binary static archive that got mangled by patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299265 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:16:22 +00:00
Reid Kleckner
761a817d06 [llvm-ar] Extract objects to their basename in the CWD
This is helpful when extracting objects from archives produced by MSVC's
lib.exe, which users absolute paths to describe the archive members.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299264 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:10:53 +00:00
Craig Topper
cba91e6d22 [InstCombine] Add test case demonstrating missed opportunities for removing add/sub when the LSBs of one input are known to be 0 and MSBs of the output aren't consumed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:08:37 +00:00
Krzysztof Parzyszek
9a9ab69f85 [Hexagon] Remove unused variables
Found by PVS-Studio. Fixes llvm.org/PR31676.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:03:59 +00:00
Krzysztof Parzyszek
8b1380a009 [Hexagon] Fix typo in HexagonEarlyIfCConv.cpp
Found by PVS-Studio. Fixes llvm.org/PR32480.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:36:00 +00:00
Stephen Canon
2215b7d1b2 Fix 80-column violation in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:35:02 +00:00
Stephen Canon
872b505b04 Fix APFloat mod (committing for simonbyrne)
The previous version was prone to intermediate rounding or overflow.

Differential Revision: https://reviews.llvm.org/D29346


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:31:33 +00:00
Sanjay Patel
0f0cd01471 [DAGCombiner] add fold for 'All sign bits set?'
(and (setlt X,  0), (setlt Y,  0)) --> (setlt (and X, Y),  0)

We have 7 similar folds, but this one got away. The fact that the
x86 test with a branch didn't change is probably a separate bug. We
may also be missing this and the related folds in instcombine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:28:06 +00:00
Stanislav Mekhanoshin
b09e7cd9e9 [AMDGPU] Remove assumption that vector and scalar types do not alias
Differential Revision: https://reviews.llvm.org/D31547

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:16:54 +00:00
Craig Topper
38017a1fee [APInt] Remove shift functions from APIntOps namespace. Replace the few users with the APInt class methods. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:01:16 +00:00
Joerg Sonnenberger
3e86a05613 Do not translate rint into nearbyint, but truncate it like nearbyint.
A common way to implement nearbyint is by fiddling with the floating
point environment and calling rint. This is used at least by the BSD
libm and musl. As such, canonicalizing the latter to the former will
create infinite loops for libm and generally pessimize performance, at
least when the generic C versions are used.

This change preserves the rint in the libcall translation and also
handles the domain truncation logic, so that rint with float argument
will be reduced to rintf etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 19:58:07 +00:00
Matt Arsenault
c4de629ce2 AMDGPU: Remove unnecessary ands when f16 is legal
Add a new node to act as a fancy bitcast from f16 operations to
i32 that implicitly zero the high 16-bits of the result.

Alternatively could try making v2f16 legal and canonicalizing
on build_vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 19:53:03 +00:00
Jan Vesely
1abd9ecbfc AMDGPU/R600: Fix amdgpu alias analysis pass.
R600 uses higher AS number to access kernel parameters

Fixes: r298846
Differential Revision: https://reviews.llvm.org/D31520

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 19:26:23 +00:00
Sanjay Patel
a694469515 [PowerPC] add tests for setcc+setcc+logic; NFC
These are the same tests added for x86 with r299238,
but PPC doesn't specify all branches as cheap, so we 
see different patterns in tests with branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:51:03 +00:00
Craig Topper
406105d95e [APInt] Rewrite getLoBits in a way that will do one less memory allocation in the multiword case. Rewrite getHiBits to use the class method version of lshr instead of the one in APIntOps. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:48:14 +00:00
Craig Topper
3eae0cb165 [APInt] Remove unused functions from the APIntOps namespace. The corresponding methods on the APInt object should be used instead. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:30:01 +00:00
Sanjay Patel
d1c650cbed [DAGCombiner] remove redundant code and add comments; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:18:58 +00:00
Balaram Makam
126805f01e [AArch64] Add new subtarget feature to fold LSL into address mode.
Summary:
This feature enables folding of logical shift operations of up to 3 places into addressing mode on Kryo and Falkor that have a fastpath LSL.

Reviewers: mcrosier, rengolin, t.p.northover

Subscribers: junbuml, gberry, llvm-commits, aemerson

Differential Revision: https://reviews.llvm.org/D31113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:16:53 +00:00
Sanjay Patel
bced0c80a5 [x86] add/consolidate tests for setcc+setcc+and/or; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299238 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:55:07 +00:00
Adam Nemet
e37d964eac Improve DebugInfo/strip-loop-metadata.ll test
This wasn't covering for the case where you have multiple latches and hence
the use of the same loop-id which needs to be mapped to the same loop-id.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:51:12 +00:00
Piotr Padlewski
f580f444f6 [MSSA] Small test fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:39:07 +00:00
Craig Topper
af26b71085 [AVX-512] Update lowering for gather/scatter prefetch intrinsics to match the immediate encodings the frontend uses based on the _MM_HINT_T0/T1 constant values in clang's headers.
Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too.

Fixes PR32411.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:24:29 +00:00
Rafael Espindola
bc8f4f4a24 Rename variable.
Requested on post commit code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:11:51 +00:00
Dehao Chen
22478be44e Fix the InstCombine to reserve the VP metadata and sets correct call count.
Summary: Currently the VP metadata was dropped when InstCombine converts a call to direct call. This patch converts the VP metadata to branch_weights so that its hotness is recorded.

Reviewers: eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31344

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 15:59:52 +00:00
Jan Sjodin
dcfd618219 Refactor code to create getFallThrough method in MachineBasicBlock.
Differential Revision: https://reviews.llvm.org/D27264



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 15:55:37 +00:00
Kristof Beyls
c295532b90 Remove name space pollution from Signals.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 14:58:52 +00:00
Petar Jovanovic
7fb9f75fc3 [mips][msa] Prevent output operand from commuting for dpadd_[su].df ins
Implementation of TargetInstrInfo::findCommutedOpIndices for MIPS target,
restricting commutativity to second and third operand only for
dpaadd_[su].df instructions therein.

Prior to this change, there were cases where the vector that is to be added
to the dot product of the other two could take a position other than the
first one in the instruction, generating false output in the destination
vector.

Such behavior has been noticed in the two functions generating v2i64 output
values so far. Other ones may exhibit such behavior as well, just not for
the vector operands which are present in the test at the moment.

Tests altered so that the function's first operand is a constant splat so
that it can be loaded with a ldi instruction, since that is the case in
which the erroneous instruction operand placement has occurred. We check
that the register which is present in the ldi instruction is placed as the
first operand in the corresponding dpadd instruction.

Patch by Stefan Maksimovic.

Differential Revision: https://reviews.llvm.org/D30827



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 14:31:55 +00:00
Kristof Beyls
1cbe5a4d1d Remove more name space pollution from .inc files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 14:26:44 +00:00
Simon Pilgrim
40593e05da [DAGCombiner] Add ComputeNumSignBits vector demanded elements support to ASHR and INSERT_VECTOR_ELT
Followup to D31311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299221 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 14:21:50 +00:00