[inliner] Skip debug intrinsics even earlier in computing the inline
authorChandler Carruth <chandlerc@gmail.com>
Sat, 1 Feb 2014 10:38:17 +0000 (10:38 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 1 Feb 2014 10:38:17 +0000 (10:38 +0000)
commitd383b8eec3aac018c0258c9e5d4ad7becf2babc3
tree6c494ed8f31605f159ab4d6646728fb048ad27cf
parent312eec7ecb712c2e75bd7c40a4460f409c486649
[inliner] Skip debug intrinsics even earlier in computing the inline
cost so that they don't impact the vector bonus. Fundamentally, counting
unsimplified instructions is just *wrong*; it will continue to introduce
instability as things which do not generate code bizarrely impact
inlining. For example, sufficiently nested inlined functions could turn
off the vector bonus with lifetime markers just like the debug
intrinsics do. =/

This is a short-term tactical fix. Long term, I think we need to remove
the vector bonus entirely. That's a separate patch and discussion
though.

The patch to fix this provided by Dario Domizioli. I've added some
comments about the planned direction and used a heavily pruned form of
debug info intrinsics for the test case. While this debug info doesn't
work or "do" anything useful, it lets us easily test all manner of
interference easily, and I suspect this will not be the last time we
want to craft a pattern where debug info interferes with the inliner in
a problematic way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200609 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IPA/InlineCost.cpp
test/Transforms/Inline/ignore-debug-info.ll [new file with mode: 0644]