[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 11:50:06 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1364d856f4bf: [Attributor][NFC] Do not manifest noundef for positions to be changed to undef (authored by okura).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86835/new/

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.288795.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200829/7153f71d/attachment.bin>


More information about the llvm-commits mailing list