[PATCH] D83507: [AssumeBundles] Fix Bug in Assume Queries
Tyker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 17 12:37:31 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa79e604462ea: [AssumeBundles] Fix Bug in Assume Queries (authored by Tyker).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83507/new/
https://reviews.llvm.org/D83507
Files:
llvm/lib/Analysis/AssumeBundleQueries.cpp
llvm/test/Transforms/PhaseOrdering/d83507-knowledge-retention-bug.ll
Index: llvm/test/Transforms/PhaseOrdering/d83507-knowledge-retention-bug.ll
===================================================================
--- llvm/test/Transforms/PhaseOrdering/d83507-knowledge-retention-bug.ll
+++ llvm/test/Transforms/PhaseOrdering/d83507-knowledge-retention-bug.ll
@@ -13,7 +13,10 @@
; ANY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(%0* [[I1]]) ]
; ANY-NEXT: [[I4:%.*]] = getelementptr inbounds [[TMP0:%.*]], %0* [[I1]], i64 0, i32 0
; ANY-NEXT: [[I5]] = load %0*, %0** [[I4]], align 8
-; ANY-NEXT: br label [[BB3]]
+; ANY-NEXT: [[I2:%.*]] = icmp eq %0* [[I5]], null
+; ANY-NEXT: br i1 [[I2]], label [[BB6:%.*]], label [[BB3]]
+; ANY: bb6:
+; ANY-NEXT: ret %0* undef
;
bb:
br label %bb1
Index: llvm/lib/Analysis/AssumeBundleQueries.cpp
===================================================================
--- llvm/lib/Analysis/AssumeBundleQueries.cpp
+++ llvm/lib/Analysis/AssumeBundleQueries.cpp
@@ -172,12 +172,15 @@
if (!II || Elem.Index == AssumptionCache::ExprResultIdx)
continue;
if (RetainedKnowledge RK = getKnowledgeFromBundle(
- *II, II->bundle_op_info_begin()[Elem.Index]))
+ *II, II->bundle_op_info_begin()[Elem.Index])) {
+ if (V != RK.WasOn)
+ continue;
if (is_contained(AttrKinds, RK.AttrKind) &&
Filter(RK, II, &II->bundle_op_info_begin()[Elem.Index])) {
NumUsefullAssumeQueries++;
return RK;
}
+ }
}
return RetainedKnowledge::none();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83507.286111.patch
Type: text/x-patch
Size: 1555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200817/1bfb8f2c/attachment.bin>
More information about the llvm-commits
mailing list