Add a missed SCEV fold that is required to continue analyzing the IR produced
commit404b357a4bc423dde8a2d6c39bc62c3887a522a6
authorNick Lewycky <nicholas@mxc.ca>
Wed, 19 Jan 2011 16:59:46 +0000 (19 16:59 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 19 Jan 2011 16:59:46 +0000 (19 16:59 +0000)
tree7ade38c10f647ed959557a49079469439b416548
parent73d0f5980db01ffe0fce504c6e437ea26d0051bd
Add a missed SCEV fold that is required to continue analyzing the IR produced
by indvars through the scev expander.

trunc(add x, y) --> add(trunc x, y). Currently SCEV largely folds the other way
which is probably wrong, but preserved to minimize churn. Instcombine doesn't
do this fold either, demonstrating a missed optz'n opportunity on code doing
add+trunc+add.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123838 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/fold.ll