llvm-6502/lib/Transforms/InstCombine
Quentin Colombet 2c6ef1c433 [InstCombiner] Expose opportunities to merge subtract and comparison.
Several architectures use the same instruction to perform both a comparison and
a subtract. The instruction selection framework does not allow to consider
different basic blocks to expose such fusion opportunities.

Therefore, these instructions are “merged” by CSE at MI IR level.

To increase the likelihood of CSE to apply in such situation, we reorder the
operands of the comparison, when they have the same complexity, so that they
matches the order of the most frequent subtract.
E.g.,

icmp A, B
...
sub B, A

<rdar://problem/14514580>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-09 20:56:48 +00:00
..
CMakeLists.txt
InstCombine.h Consistently use dbgs() in debug printing 2013-09-05 19:48:28 +00:00
InstCombineAddSub.cpp
InstCombineAndOrXor.cpp InstCombine: allow unmasked icmps to be combined with logical ops 2013-09-04 11:57:17 +00:00
InstCombineCalls.cpp
InstCombineCasts.cpp Teach InstCombine about address spaces 2013-08-21 19:53:10 +00:00
InstCombineCompares.cpp [InstCombiner] Expose opportunities to merge subtract and comparison. 2013-09-09 20:56:48 +00:00
InstCombineLoadStoreAlloca.cpp Teach InstCombineLoadCast about address spaces. 2013-09-03 21:05:48 +00:00
InstCombineMulDivRem.cpp
InstCombinePHI.cpp Consistently use dbgs() in debug printing 2013-09-05 19:48:28 +00:00
InstCombineSelect.cpp
InstCombineShifts.cpp
InstCombineSimplifyDemanded.cpp InstCombine: Check for zero shift amounts before subtracting one causing integer overflow. 2013-08-30 14:35:35 +00:00
InstCombineVectorOps.cpp Use type helper functions. 2013-09-06 00:37:24 +00:00
InstCombineWorklist.h Consistently use dbgs() in debug printing 2013-09-05 19:48:28 +00:00
InstructionCombining.cpp Consistently use dbgs() in debug printing 2013-09-05 19:48:28 +00:00
LLVMBuild.txt
Makefile