llvm-6502/lib/Transforms/InstCombine
Duncan Sands 593faa53fa My auto-simplifier noticed that ((X/Y)*Y)/Y occurs several times in SPEC
benchmarks, and that it can be simplified to X/Y.  (In general you can only
simplify (Z*Y)/Y to Z if the multiplication did not overflow; if Z has the
form "X/Y" then this is the case).  This patch implements that transform and
moves some Div logic out of instcombine and into InstructionSimplify.
Unfortunately instcombine gets in the way somewhat, since it likes to change
(X/Y)*Y into X-(X rem Y), so I had to teach instcombine about this too.
Finally, thanks to the NSW/NUW flags, sometimes we know directly that "Z*Y"
does not overflow, because the flag says so, so I added that logic too.  This
eliminates a bunch of divisions and subtractions in 447.dealII, and has good
effects on some other benchmarks too.  It seems to have quite an effect on
tramp3d-v4 but it's hard to say if it's good or bad because inlining decisions
changed, resulting in massive changes all over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124487 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-28 16:51:11 +00:00
..
CMakeLists.txt Removed a bunch of unnecessary target_link_libraries. 2010-09-28 22:39:14 +00:00
InstCombine.h remove the AllowAggressive argument to FoldOpIntoPhi. It is forced to false in the 2011-01-16 05:14:26 +00:00
InstCombineAddSub.cpp one more instcombine variant that is needed to work with future changes, 2011-01-15 05:50:18 +00:00
InstCombineAndOrXor.cpp Just because we have determined that an (fcmp | fcmp) is true for A < B, 2011-01-21 19:39:42 +00:00
InstCombineCalls.cpp Teach instcombine about the rest of the SSE and SSE2 conversion 2011-01-10 07:19:37 +00:00
InstCombineCasts.cpp implement an instcombine xform that canonicalizes casts outside of and-with-constant operations. 2011-01-15 06:32:33 +00:00
InstCombineCompares.cpp At -O123 the early-cse pass is run before instcombine has run. According to my 2011-01-20 13:21:55 +00:00
InstCombineLoadStoreAlloca.cpp Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils. 2010-12-25 20:37:57 +00:00
InstCombineMulDivRem.cpp My auto-simplifier noticed that ((X/Y)*Y)/Y occurs several times in SPEC 2011-01-28 16:51:11 +00:00
InstCombinePHI.cpp Teach InstructionSimplify about phi nodes. I chose to have it simply 2010-11-14 13:30:18 +00:00
InstCombineSelect.cpp Fold select + select where both selects are on the same condition. 2011-01-28 03:28:10 +00:00
InstCombineShifts.cpp Null initialize a few variables flagged by 2011-01-23 17:05:06 +00:00
InstCombineSimplifyDemanded.cpp PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and 2010-12-07 08:25:19 +00:00
InstCombineVectorOps.cpp PR5207: Rename overloaded APInt methods set(), clear(), flip() to 2010-12-01 08:53:58 +00:00
InstCombineWorklist.h I got tired of VISIBILITY_HIDDEN colliding with the gcc enum. Rename it 2010-05-11 20:16:09 +00:00
InstructionCombining.cpp fix PR9013, an infinite loop in instcombine. 2011-01-21 05:29:50 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00