summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorMikael Holmen <mikael.holmen@ericsson.com>2019-09-26 06:35:55 +0000
committerMikael Holmen <mikael.holmen@ericsson.com>2019-09-26 06:35:55 +0000
commit957e090ac958d55092b9bcebc4abf896fc01b712 (patch)
tree144ed7caf52a47ffa2507a8dc9b258ada45d3f3a /llvm/lib/CodeGen
parent4ed9793f980fd6c07f8f55cc8463301c3521f679 (diff)
downloadbcm5719-llvm-957e090ac958d55092b9bcebc4abf896fc01b712.tar.gz
bcm5719-llvm-957e090ac958d55092b9bcebc4abf896fc01b712.zip
[IfConversion] Disallow TBB == FBB for valid triangles
Summary: Previously the case EBB | \_ | | | TBB | / FBB was treated as a valid triangle also when TBB and FBB was the same basic block. This could then lead to an invalid CFG when we removed the edge from EBB to TBB, since that meant we would also remove the edge from EBB to FBB. Since TBB == FBB is quite a degenerated case of a triangle, we now don't treat it as a valid triangle anymore, and thus we will avoid the trouble with updating the CFG. Reviewers: efriedma, dmgreen, kparzysz Reviewed By: efriedma Subscribers: bjope, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67832 llvm-svn: 372943
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 99f59f2f946..8cd04b1b091 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -569,6 +569,9 @@ bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
bool FalseBranch, unsigned &Dups,
BranchProbability Prediction) const {
Dups = 0;
+ if (TrueBBI.BB == FalseBBI.BB)
+ return false;
+
if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
return false;
OpenPOWER on IntegriCloud