aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-04-07 00:30:15 +0000
committerDevang Patel <dpatel@apple.com>2011-04-07 00:30:15 +0000
commitae6c95b58e78403707fb75e78f0959a86d57b0c5 (patch)
tree8ddf036f0ddc5eca932cdf62d8fe451beaca6e76
parent84025ba08ff23711b9d3d33c6c21819d63d30865 (diff)
downloadexternal_llvm-ae6c95b58e78403707fb75e78f0959a86d57b0c5.zip
external_llvm-ae6c95b58e78403707fb75e78f0959a86d57b0c5.tar.gz
external_llvm-ae6c95b58e78403707fb75e78f0959a86d57b0c5.tar.bz2
Simplify. isIdenticalToWhenDefined() checks opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129041 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index a181e3e..286b165 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -811,8 +811,7 @@ static bool HoistThenElseCodeToIf(BranchInst *BI) {
I1 = BB1_Itr++;
while (isa<DbgInfoIntrinsic>(I2))
I2 = BB2_Itr++;
- if (I1->getOpcode() != I2->getOpcode() || isa<PHINode>(I1) ||
- !I1->isIdenticalToWhenDefined(I2) ||
+ if (isa<PHINode>(I1) || !I1->isIdenticalToWhenDefined(I2) ||
(isa<InvokeInst>(I1) && !isSafeToHoistInvoke(BB1, BB2, I1, I2)))
return false;
@@ -840,8 +839,7 @@ static bool HoistThenElseCodeToIf(BranchInst *BI) {
I2 = BB2_Itr++;
while (isa<DbgInfoIntrinsic>(I2))
I2 = BB2_Itr++;
- } while (I1->getOpcode() == I2->getOpcode() &&
- I1->isIdenticalToWhenDefined(I2));
+ } while (I1->isIdenticalToWhenDefined(I2));
return true;