From 6d2db9edb2e66162dd85d4ccca67840aceb76966 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Wed, 14 Jun 2017 21:19:52 +0000 Subject: PredicateInfo: Don't insert conditional info when a conditional branch jumps to the same target regardless of condition llvm-svn: 305416 --- llvm/lib/Transforms/Utils/PredicateInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp') diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 9e71cba4f1b..1260e35e934 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -460,6 +460,9 @@ void PredicateInfo::buildPredicateInfo() { if (auto *BI = dyn_cast(BranchBB->getTerminator())) { if (!BI->isConditional()) continue; + // Can't insert conditional information if they all go to the same place. + if (BI->getSuccessor(0) == BI->getSuccessor(1)) + continue; processBranch(BI, BranchBB, OpsToRename); } else if (auto *SI = dyn_cast(BranchBB->getTerminator())) { processSwitch(SI, BranchBB, OpsToRename); -- cgit v1.2.3