[PATCH] D65222: [IPSCCP] Add assertion to surface cases where we zap returns with overdefined users.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 02:37:26 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366998: [IPSCCP] Add assertion to surface cases where we zap returns with overdefined… (authored by fhahn, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65222?vs=211538&id=211701#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65222

Files:
  llvm/trunk/lib/Transforms/Scalar/SCCP.cpp


Index: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
@@ -1924,6 +1924,21 @@
     return;
   }
 
+  assert(
+      all_of(F.users(),
+             [&Solver](User *U) {
+               if (isa<Instruction>(U) &&
+                   !Solver.isBlockExecutable(cast<Instruction>(U)->getParent()))
+                 return false;
+               if (U->getType()->isStructTy()) {
+                 return all_of(
+                     Solver.getStructLatticeValueFor(U),
+                     [](const LatticeVal &LV) { return !LV.isOverdefined(); });
+               }
+               return !Solver.getLatticeValueFor(U).isOverdefined();
+             }) &&
+      "We can only zap functions where all live users have a concrete value");
+
   for (BasicBlock &BB : F) {
     if (CallInst *CI = BB.getTerminatingMustTailCall()) {
       LLVM_DEBUG(dbgs() << "Can't zap return of the block due to present "


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65222.211701.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190725/54180cb2/attachment.bin>


More information about the llvm-commits mailing list