[PATCH] D85881: Fix PR45442: Bail out when MemorySSA information is not available

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 09:41:25 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:525
+    // MemoryUseDef information is not available, bail out.
+    if (!U)
+      return false;
----------------
IMO I think it would preferable to check at the call site where we get the MemoryUseOrDef and not call safeToHoistLdSt without MemoryUseOrDef.


================
Comment at: llvm/test/Transforms/GVNHoist/pr45442.ll:21
+entry:
+  br i1 undef, label %bb1, label %bb2
+
----------------
nit: branch on undef is UB, so it is probably best to avoid it and use a `i1 ` parameter or something instead


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

https://reviews.llvm.org/D85881



More information about the llvm-commits mailing list