]> granicus.if.org Git - llvm/commit
Inlining: Don't re-map simplified cloned instructions.
authorKyle Butt <kyle+llvm@iteratee.net>
Wed, 28 Jun 2017 01:41:25 +0000 (01:41 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Wed, 28 Jun 2017 01:41:25 +0000 (01:41 +0000)
commitfa84770d2096fe96b1f18f42b936af7616b95c50
tree72b327426656059e2f422c445c6b83437030aa99
parent59d9d429cca3ba1cbdc9a5bb3e84008f06930810
Inlining: Don't re-map simplified cloned instructions.

When simplifying an instruction that has been re-mapped, it should never
simplify to an instruction in the original function. In the edge case
where we are inlining a function into itself, the existing code led to
incorrect behavior. Replace the incorrect code with an assert verifying
that we never expect simplification to produce an instruction in the old
function, unless the functions are the same.

Differential Revision: https://reviews.llvm.org/D33850

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306495 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/CloneFunction.cpp