Commit Graph

147187 Commits

Author SHA1 Message Date
Craig Topper
9bf6f549d3 [APInt] Implement flipAllBitsSlowCase with tcComplement. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 21:50:08 +00:00
Craig Topper
ef14ce8e1b [APInt] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 21:50:06 +00:00
Craig Topper
e222bade09 [APInt] Implement AndAssignSlowCase using tcAnd. Do the same for Or and Xor. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 21:50:03 +00:00
Craig Topper
2ea3d99e26 [APInt] Allow GreatestCommonDivisor to take rvalue inputs efficiently. Use moves instead of copies in the loop.
Summary:
GreatestComonDivisor currently makes a copy of both its inputs. Then in the loop we do one move and two copies, plus any allocation the urem call does.

This patch changes it to take its inputs by value so that we can do a move of any rvalue inputs instead of copying. Then in the loop we do 3 move assignments and no copies. This way the only possible allocations we have in the loop is from the urem call.

Reviewers: dblaikie, RKSimon, hans

Reviewed By: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299314 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 20:30:57 +00:00
Davide Italiano
084c1ea3b4 [WASM] Remove other comparison of unsigned expression >= 0.
This should finally fix the GCC 7 build with -Werror.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:47:52 +00:00
Davide Italiano
913760d689 [WASM] Remove a set but never used variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:40:51 +00:00
Davide Italiano
ad53f4b9c2 [WASM] Remove an assertion that can never fire.
uint* is by definition always >=0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:37:15 +00:00
Davide Italiano
0b798207e7 [AMDGPU] Garbage collect now unused dead code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:30:17 +00:00
Sanjay Patel
6d5ad7b563 [InstSimplify] add constant folding for fdiv/frem
Also, add a helper function so we don't have to repeat this code for each binop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:05:11 +00:00
Sanjay Patel
08e6f17325 [InstSimplify] add tests for missed constant folding; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 18:44:03 +00:00
Sanjay Patel
c1440de334 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 18:40:30 +00:00
Sanjay Patel
e02485adce fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 15:53:12 +00:00
Sanjay Patel
c2d4aab4d9 [DAGCombiner] enable vector transforms for any/all {sign} bits set/clear
The code already allowed vector types in via "isInteger" (which might want
a more specific name), so use splat-friendly constant predicates to match
those types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 15:05:54 +00:00
Sanjay Patel
8159cf81b9 [PowerPC, x86] add vector tests for any/all {sign} bits set/clear; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299303 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 14:32:18 +00:00
Daniel Berlin
9d36a3c545 MemorySSA: Update expensive checking version of def_chain_iterator for templating changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 10:04:28 +00:00
Daniel Berlin
b0cedc77cb NewGVN: Don't try to kill off the stored value of stores when
processing the congruence class of the store.
Because we use the stored value of a store as the def, it isn't dead
just because it appears as a def when it comes from a store.

Note: I have not hit any cases with the memory code as it is where
this breaks anything, just because of what memory congruences we
actually allow.  In a followup that improves memory congruence,
this bug actually breaks real stuff (but the verifier catches it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299300 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:44:33 +00:00
Daniel Berlin
1a42d5c3bd NewGVN: Clean up GVNExpression memory hierarchy, restructure hash computation a bit so we don't have to redefine it for loads, stores, and calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:44:29 +00:00
Daniel Berlin
fa75a7ca5c NewGVN: Use def_chain iterator in singleReachablePhiPath instead of recursion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:44:24 +00:00
Daniel Berlin
3a5434ad3a Move def_chain iterator to MemorySSA.h so it can be reused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:44:19 +00:00
Daniel Berlin
eea3e1dabc MemorySSA.h - make clang-format happy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:44:14 +00:00
Daniel Berlin
ae7bf03f7c MemorySSA: Push const correctness further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299295 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 09:01:12 +00:00
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