[PATCH] D36590: [ValueTracking] don't delete assumes of side-effectful instructions
Hal Finkel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 10:12:58 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL310859: [ValueTracking] Don't delete assumes of side-effectful instructions (authored by hfinkel).
Changed prior to commit:
https://reviews.llvm.org/D36590?vs=110625&id=111023#toc
Repository:
rL LLVM
https://reviews.llvm.org/D36590
Files:
llvm/trunk/lib/Analysis/ValueTracking.cpp
llvm/trunk/test/Analysis/ValueTracking/assume.ll
Index: llvm/trunk/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp
@@ -384,13 +384,13 @@
if (V == E)
return true;
- EphValues.insert(V);
- if (const User *U = dyn_cast<User>(V))
- for (User::const_op_iterator J = U->op_begin(), JE = U->op_end();
- J != JE; ++J) {
- if (isSafeToSpeculativelyExecute(*J))
- WorkSet.push_back(*J);
- }
+ if (V == I || isSafeToSpeculativelyExecute(V)) {
+ EphValues.insert(V);
+ if (const User *U = dyn_cast<User>(V))
+ for (User::const_op_iterator J = U->op_begin(), JE = U->op_end();
+ J != JE; ++J)
+ WorkSet.push_back(*J);
+ }
}
}
Index: llvm/trunk/test/Analysis/ValueTracking/assume.ll
===================================================================
--- llvm/trunk/test/Analysis/ValueTracking/assume.ll
+++ llvm/trunk/test/Analysis/ValueTracking/assume.ll
@@ -18,5 +18,16 @@
ret i32 %t3
}
-declare void @llvm.assume(i1)
+define void @assume_not() {
+; CHECK-LABEL: @assume_not(
+entry-block:
+ %0 = call i1 @get_val()
+; CHECK: call void @llvm.assume
+ %1 = xor i1 %0, true
+ call void @llvm.assume(i1 %1)
+ ret void
+}
+
+declare i1 @get_val()
+declare void @llvm.assume(i1)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36590.111023.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170814/8fe039e5/attachment.bin>
More information about the llvm-commits
mailing list