summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-28 16:51:11 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-28 16:51:11 +0000
commit771e82a86370ff39fbe9611e7d4a8213e03915bc (patch)
tree8d32f06f26bb43fde868a69c7a930cde1be44d94 /llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
parente789bdb870a2c4ddd72df310aa7357c0ca18bf6a (diff)
downloadbcm5719-llvm-771e82a86370ff39fbe9611e7d4a8213e03915bc.tar.gz
bcm5719-llvm-771e82a86370ff39fbe9611e7d4a8213e03915bc.zip
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. llvm-svn: 124487
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud