[PATCH] D57129: [SimpleLoopUnswitch] Early check exit for trivial unswitch with MemorySSA.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 09:50:27 PST 2019


This revision was automatically updated to reflect the committed changes.
asbirlea marked an inline comment as done.
Closed by commit rL352393: [SimpleLoopUnswitch] Early check exit for trivial unswitch with MemorySSA. (authored by asbirlea, committed by ).

Repository:
  rL LLVM

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

https://reviews.llvm.org/D57129

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


Index: llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -847,6 +847,10 @@
     // Check if there are any side-effecting instructions (e.g. stores, calls,
     // volatile loads) in the part of the loop that the code *would* execute
     // without unswitching.
+    if (MSSAU) // Possible early exit with MSSA
+      if (auto *Defs = MSSAU->getMemorySSA()->getBlockDefs(CurrentBB))
+        if (!isa<MemoryPhi>(*Defs->begin()) || (++Defs->begin() != Defs->end()))
+          return Changed;
     if (llvm::any_of(*CurrentBB,
                      [](Instruction &I) { return I.mayHaveSideEffects(); }))
       return Changed;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57129.183894.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/13e51ee5/attachment.bin>


More information about the llvm-commits mailing list