llvm-6502/lib/Transforms/InstCombine
Duncan Sands 096aa79276 Generalize the reassociation transform in SimplifyCommutative (now renamed to
SimplifyAssociativeOrCommutative) "(A op C1) op C2" -> "A op (C1 op C2)",
which previously was only done if C1 and C2 were constants, to occur whenever
"C1 op C2" simplifies (a la InstructionSimplify).  Since the simplifying operand
combination can no longer be assumed to be the right-hand terms, consider all of
the possible permutations.  When compiling "gcc as one big file", transform 2
(i.e. using right-hand operands) fires about 4000 times but it has to be said
that most of the time the simplifying operands are both constants.  Transforms
3, 4 and 5 each fired once.  Transform 6, which is an existing transform that
I didn't change, never fired.  With this change, the testcase is now optimized
perfectly with one run of instcombine (previously it required instcombine +
reassociate + instcombine, and it may just have been luck that this worked).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 15:10:37 +00:00
..
CMakeLists.txt
InstCombine.h Generalize the reassociation transform in SimplifyCommutative (now renamed to 2010-11-13 15:10:37 +00:00
InstCombineAddSub.cpp Generalize the reassociation transform in SimplifyCommutative (now renamed to 2010-11-13 15:10:37 +00:00
InstCombineAndOrXor.cpp Generalize the reassociation transform in SimplifyCommutative (now renamed to 2010-11-13 15:10:37 +00:00
InstCombineCalls.cpp
InstCombineCasts.cpp
InstCombineCompares.cpp
InstCombineLoadStoreAlloca.cpp
InstCombineMulDivRem.cpp Generalize the reassociation transform in SimplifyCommutative (now renamed to 2010-11-13 15:10:37 +00:00
InstCombinePHI.cpp
InstCombineSelect.cpp
InstCombineShifts.cpp
InstCombineSimplifyDemanded.cpp
InstCombineVectorOps.cpp
InstCombineWorklist.h
InstructionCombining.cpp Generalize the reassociation transform in SimplifyCommutative (now renamed to 2010-11-13 15:10:37 +00:00
Makefile