OSDN Git Service

[SimplifyCFG] Fix nasty RAUW bug from r277325
authorJames Molloy <james.molloy@arm.com>
Mon, 1 Aug 2016 09:34:48 +0000 (09:34 +0000)
committerJames Molloy <james.molloy@arm.com>
Mon, 1 Aug 2016 09:34:48 +0000 (09:34 +0000)
commita77b56f25466da561aa03ea230b872f9b216d72a
tree6d81658d980539b476cf35c4758a19f51bc2e940
parentdeeb6ba1ab5f54c1572b02e5a6a638ba14ebc095
[SimplifyCFG] Fix nasty RAUW bug from r277325

Using RAUW was wrong here; if we have a switch transform such as:
  18 -> 6 then
  6 -> 0

If we use RAUW, while performing the second transform the  *transformed* 6
from the first will be also replaced, so we end up with:
  18 -> 0
  6 -> 0

Found by clang stage2 bootstrap; testcase added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277332 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/rangereduce.ll