[PATCH] D67832: [IfConversion] Disallow TBB == FBB for valid triangles
Mikael Holmén via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 04:42:51 PDT 2019
uabelho updated this revision to Diff 221719.
uabelho retitled this revision from "[IfConversion] Handle when CvtMBB==NextMBB in IfConvertTriangle" to " [IfConversion] Disallow TBB == FBB for valid triangles".
uabelho edited the summary of this revision.
uabelho added a comment.
Disallow this case in ValidTriangle instead.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67832/new/
https://reviews.llvm.org/D67832
Files:
llvm/lib/CodeGen/IfConversion.cpp
llvm/test/CodeGen/ARM/ifcvt_triangleSameCvtNext.mir
Index: llvm/test/CodeGen/ARM/ifcvt_triangleSameCvtNext.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/ARM/ifcvt_triangleSameCvtNext.mir
@@ -0,0 +1,29 @@
+# RUN: llc -mtriple=arm-apple-ios -run-pass=if-converter -verify-machineinstrs %s -o - | FileCheck %s
+...
+---
+name: foo
+body: |
+ bb.0:
+ Bcc %bb.2, 1, $cpsr
+
+ bb.1:
+ $sp = tADDspi $sp, 2, 14, _
+ B %bb.1
+
+ bb.2:
+ Bcc %bb.3, 0, $cpsr
+ B %bb.2
+
+ bb.3:
+ Bcc %bb.1, 1, $cpsr
+ B %bb.1
+...
+
+# Both branches in bb.3 jump to bb.1. IfConversion shouldn't treat this as a
+# tringle and insert the tADDspi in bb3, but leave it as it is.
+
+# CHECK: bb.3:
+# CHECK: successors: %bb.1
+# CHECK-NOT: tADDspi
+# CHECK: Bcc %bb.1, 1, $cpsr
+# CHECK: B %bb.1
Index: llvm/lib/CodeGen/IfConversion.cpp
===================================================================
--- llvm/lib/CodeGen/IfConversion.cpp
+++ llvm/lib/CodeGen/IfConversion.cpp
@@ -569,6 +569,9 @@
bool FalseBranch, unsigned &Dups,
BranchProbability Prediction) const {
Dups = 0;
+ if (TrueBBI.BB == FalseBBI.BB)
+ return false;
+
if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67832.221719.patch
Type: text/x-patch
Size: 1331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190925/9406b8f5/attachment.bin>
More information about the llvm-commits
mailing list