[PATCH] D86842: [Attributor][NFC] Fix dependency type in AAUndefinedBehaviorImpl::updateImpl
Shinji Okumura via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 14:04:38 PDT 2020
okura created this revision.
Herald added subscribers: llvm-commits, kuter, danielkiss, uenoku, hiraditya.
Herald added a reviewer: uenoku.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: homerdin.
Herald added a project: LLVM.
okura requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a subscriber: bbn.
This patch fixes wrong dependency type in AAUB.
https://reviews.llvm.org/D86842
Files:
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp
===================================================================
--- llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -2024,11 +2024,14 @@
IRPosition CalleeArgumentIRP = IRPosition::callsite_argument(CB, idx);
if (!CalleeArgumentIRP.hasAttr({Attribute::NoUndef}))
continue;
- auto &NonNullAA = A.getAAFor<AANonNull>(*this, CalleeArgumentIRP);
+ auto &NonNullAA = A.getAAFor<AANonNull>(*this, CalleeArgumentIRP,
+ /* TrackDependence */ true,
+ DepClassTy::OPTIONAL);
if (!NonNullAA.isKnownNonNull())
continue;
- const auto &ValueSimplifyAA =
- A.getAAFor<AAValueSimplify>(*this, IRPosition::value(*ArgVal));
+ const auto &ValueSimplifyAA = A.getAAFor<AAValueSimplify>(
+ *this, IRPosition::value(*ArgVal), /* TrackDependence */ true,
+ DepClassTy::OPTIONAL);
Optional<Value *> SimplifiedVal =
ValueSimplifyAA.getAssumedSimplifiedValue(A);
@@ -2071,7 +2074,7 @@
} else {
if (isa<ConstantPointerNull>(V)) {
auto &NonNullAA = A.getAAFor<AANonNull>(
- *this, IRPosition::returned(*getAnchorScope()));
+ *this, IRPosition::returned(*getAnchorScope()), /* TrackDependence */ true, DepClassTy::OPTIONAL);
if (NonNullAA.isKnownNonNull())
FoundUB = true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86842.288814.patch
Type: text/x-patch
Size: 1608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200829/bb1eb440/attachment-0001.bin>
More information about the llvm-commits
mailing list