[PATCH] D85881: Fix PR45442: Bail out when MemorySSA information is not available
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 13 09:54:17 PDT 2020
hiraditya added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:525
+ // MemoryUseDef information is not available, bail out.
+ if (!U)
+ return false;
----------------
fhahn wrote:
> IMO I think it would preferable to check at the call site where we get the MemoryUseOrDef and not call safeToHoistLdSt without MemoryUseOrDef.
Sure, i'll do that.
================
Comment at: llvm/test/Transforms/GVNHoist/pr45442.ll:21
+entry:
+ br i1 undef, label %bb1, label %bb2
+
----------------
fhahn wrote:
> nit: branch on undef is UB, so it is probably best to avoid it and use a `i1 ` parameter or something instead
Makes sense, i'll amend the testcase. The test case was reported in the PR so i added as is. Thanks for pointing out.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85881/new/
https://reviews.llvm.org/D85881
More information about the llvm-commits
mailing list