[PATCH] D69963: Handling null AssumptionCache in simplifyCFG

Rodrigo Caetano Rocha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 13:00:24 PST 2019


rcorcs created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

AssumptionCache can be null in SimplifyCFGOptions. However, FoldCondBranchOnPHI() was not properly handling that when passing a null AssumptionCache to simplifyCFG.


Repository:
  rL LLVM

https://reviews.llvm.org/D69963

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp


Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp
===================================================================
--- llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2269,7 +2269,7 @@
 
       // Register the new instruction with the assumption cache if necessary.
       if (auto *II = dyn_cast_or_null<IntrinsicInst>(N))
-        if (II->getIntrinsicID() == Intrinsic::assume)
+        if (AC && II->getIntrinsicID() == Intrinsic::assume)
           AC->registerAssumption(II);
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69963.228293.patch
Type: text/x-patch
Size: 536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191107/06154dfd/attachment.bin>


More information about the llvm-commits mailing list