1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib/Transforms/InstCombine
Craig Topper 6dbd706f89 [InstCombine] Teach visitICmpInst to not break integer absolute value idioms
Summary:
This patch adds an early out to visitICmpInst if we are looking at a compare as part of an integer absolute value idiom. Similar is already done for min/max.

In the particular case I observed in a benchmark we had an absolute value of a load from an indexed global. We simplified the compare using foldCmpLoadFromIndexedGlobal into a magic bit vector, a shift, and an and. But the load result was still used for the select and the negate part of the absolute valute idiom. So we overcomplicated the code and lost the ability to recognize it as an absolute value.

I've chosen a simpler case for the test here.

Reviewers: spatel, davide, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 317994
2017-11-12 02:28:21 +00:00
..
CMakeLists.txt
InstCombineAddSub.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombineAndOrXor.cpp [ValueTracking, InstCombine] canonicalize fcmp ord/uno with non-NAN ops to null constants 2017-09-05 23:13:13 +00:00
InstCombineCalls.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombineCasts.cpp [InstCombine] Fix a vector splat handling bug in transformZExtICmp. 2017-10-05 07:59:11 +00:00
InstCombineCompares.cpp [InstCombine] Teach visitICmpInst to not break integer absolute value idioms 2017-11-12 02:28:21 +00:00
InstCombineInternal.h Create instruction classes for identifying any atomicity of memory intrinsic. (NFC) 2017-10-30 19:51:48 +00:00
InstCombineLoadStoreAlloca.cpp Update getMergedLocation to check the instruction type and merge properly. 2017-10-02 18:13:14 +00:00
InstCombineMulDivRem.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombinePHI.cpp Renable r314928 2017-10-10 05:07:54 +00:00
InstCombineSelect.cpp [InstCombine] Simplify selects that test cmpxchg instructions 2017-10-31 12:34:02 +00:00
InstCombineShifts.cpp Recommit r317510 "[InstCombine] Pull shifts through a select plus binop with constant" 2017-11-07 18:47:24 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine] improve demanded vector elements analysis of insertelement 2017-08-31 15:57:17 +00:00
InstCombineVectorOps.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-24 21:24:53 +00:00
InstructionCombining.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-24 21:24:53 +00:00
LLVMBuild.txt