[PATCH] D88725: [GVN LoadPRE] Extend the scope of optimization by using context to prove safety of speculation

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 19:28:52 PDT 2020


skatkov added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:1170
     // Check that there is no implicit control flow in a block above.
-    if (!IsSafeToSpeculativelyExecute && ICF->hasICF(TmpBB))
-      return false;
+    NeedSafeToSpeculativelyExecute =
+        NeedSafeToSpeculativelyExecute || ICF->hasICF(TmpBB);
----------------
reames wrote:
> Use "|=" please.
I do not need to execute ICF->hasICF(TmpBB) if I know that I need safe speculation already.
|| gives me exactly this wil |= will force the redundant execution of ICF->hasICF(TmpBB).


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

https://reviews.llvm.org/D88725



More information about the llvm-commits mailing list