diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-06-05 20:38:42 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-05 20:38:42 +0000 |
commit | e004317c66651a7bf8cdea7c15060c1f357c0e3e (patch) | |
tree | 4ed9a392e87f3d8468254d343332bab6933bc6e8 /lib | |
parent | a301a168417b326014310b31c9e3ac0ca496cf17 (diff) | |
download | external_llvm-e004317c66651a7bf8cdea7c15060c1f357c0e3e.zip external_llvm-e004317c66651a7bf8cdea7c15060c1f357c0e3e.tar.gz external_llvm-e004317c66651a7bf8cdea7c15060c1f357c0e3e.tar.bz2 |
Do not ifcvt if either true / false path is a backedge. Not profitable in almost all cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/IfConversion.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index c0c6b38..9a35d1d 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -237,6 +237,9 @@ void IfConverter::StructuralAnalysis(MachineBasicBlock *BB) { !TII->AnalyzeBranch(*BB, BBI.TrueBB, BBI.FalseBB, BBI.BrCond); if (!BBI.IsAnalyzable || BBI.BrCond.size() == 0) return; + // Do not ifcvt if either path is a back edge to the entry block. + if (BBI.TrueBB == BB || BBI.FalseBB == BB) + return; StructuralAnalysis(BBI.TrueBB); BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; |