[PATCH] D86835: [Attributor][NFC] Do not manifest noundef for positions to be changed to undef
Shinji Okumura via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 02:48:29 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 AANoUndef manifestation.
We should not manifest noundef for positions that will be changed to undef.
https://reviews.llvm.org/D86835
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
@@ -7812,6 +7812,13 @@
// values.
if (A.isAssumedDead(getIRPosition(), nullptr, nullptr))
return ChangeStatus::UNCHANGED;
+ // A position whose simplified value does not have any value is
+ // considered to be dead. We don't manifest noundef in such positions for
+ // the same reason above.
+ auto &ValueSimplifyAA = A.getAAFor<AAValueSimplify>(
+ *this, getIRPosition(), /* TrackDependence */ false);
+ if (!ValueSimplifyAA.getAssumedSimplifiedValue(A).hasValue())
+ return ChangeStatus::UNCHANGED;
return AANoUndef::manifest(A);
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86835.288768.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200829/e89de61e/attachment.bin>
More information about the llvm-commits
mailing list