summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-28 14:43:42 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-28 14:43:42 +0000
commit86ed53089fc0bff84b472f89ba42da8ea1a3df86 (patch)
tree48daa097966da56c81dd251b860e9363e3e21567 /llvm/lib/Analysis/InstructionSimplify.cpp
parent753e21d057b2e6f2d73e67b738fa870cfa093d6d (diff)
downloadbcm5719-llvm-86ed53089fc0bff84b472f89ba42da8ea1a3df86.tar.gz
bcm5719-llvm-86ed53089fc0bff84b472f89ba42da8ea1a3df86.zip
Fix a stunning oversight in the inline cost analysis. It was never
propagating one of the values it simplified to a constant across a myriad of instructions. Notably, ptrtoint instructions when we had a constant pointer (say, 0) didn't propagate that, blocking a massive number of down-stream optimizations. This was uncovered when investigating why we fail to inline and delete the boilerplate in: void f() { std::vector<int> v; v.push_back(1); } It turns out most of the efforts I've made thus far to improve the analysis weren't making it far purely because of this. After this is fixed, the store-to-load forwarding patch enables LLVM to optimize the above to an empty function. We still can't nuke a second push_back, but for different reasons. There is a very real chance this will cause somewhat noticable changes in inlining behavior, so please let me know if you see regressions (or improvements!) because of this patch. llvm-svn: 171196
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud