[PATCH] D61154: [PredicateInfo] Do not process unreachable operands.
Taewook Oh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 12:35:09 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360796: [PredicateInfo] Do not process unreachable operands. (authored by twoh, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D61154?vs=199657&id=199660#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61154/new/
https://reviews.llvm.org/D61154
Files:
llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
llvm/trunk/test/Transforms/Util/PredicateInfo/unreachable.ll
Index: llvm/trunk/test/Transforms/Util/PredicateInfo/unreachable.ll
===================================================================
--- llvm/trunk/test/Transforms/Util/PredicateInfo/unreachable.ll
+++ llvm/trunk/test/Transforms/Util/PredicateInfo/unreachable.ll
@@ -0,0 +1,25 @@
+; RUN: opt -print-predicateinfo < %s 2>&1 | FileCheck %s
+
+declare void @foo()
+declare void @llvm.assume(i1)
+
+define void @bar(i32* %p) {
+entry:
+; CHECK-LABEL: @bar
+ br label %end
+
+unreachable1:
+ %v1 = load i32, i32* %p, align 4
+ %c1 = icmp eq i32 %v1, 0
+ call void @llvm.assume(i1 %c1)
+ br label %unreachable2
+
+unreachable2:
+ %v2 = load i32, i32* %p, align 4
+ %c2 = icmp eq i32 %v2, 0
+ call void @llvm.assume(i1 %c2)
+ br label %end
+
+end:
+ ret void
+}
Index: llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
+++ llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
@@ -473,7 +473,8 @@
}
for (auto &Assume : AC.assumptions()) {
if (auto *II = dyn_cast_or_null<IntrinsicInst>(Assume))
- processAssume(II, II->getParent(), OpsToRename);
+ if (DT.isReachableFromEntry(II->getParent()))
+ processAssume(II, II->getParent(), OpsToRename);
}
// Now rename all our operations.
renameUses(OpsToRename);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61154.199660.patch
Type: text/x-patch
Size: 1367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190515/81b4bfb9/attachment.bin>
More information about the llvm-commits
mailing list