[PATCH] D101289: [SimplifyCFG] Use applyUpdatesPermissive in HoistThenElseCodeToIf.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 05:37:33 PDT 2021


fhahn created this revision.
fhahn added reviewers: spatel, RKSimon, lebedev.ri.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.

The updates can in theory contain duplicates if the branch has the same
true and false successors. This is not really an issue when used in
SimplifyCFG, because such branches are simplified first. But it could
happen if it is used as a utility.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101289

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
@@ -1623,7 +1623,7 @@
 
   EraseTerminatorAndDCECond(BI);
   if (DTU)
-    DTU->applyUpdates(Updates);
+    DTU->applyUpdatesPermissive(Updates);
   return Changed;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101289.340494.patch
Type: text/x-patch
Size: 379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210426/084f66e8/attachment.bin>


More information about the llvm-commits mailing list