[PATCH] D106667: SROA: Enhance speculateSelectInstLoads

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 13:33:47 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:1342-1346
+    BitCastInst *BC = dyn_cast<BitCastInst>(U);
+    if (BC && BC->hasOneUse())
+      LI = dyn_cast<LoadInst>(*BC->user_begin());
+    else
+      LI = dyn_cast<LoadInst>(U);
----------------
I think other places that handle this use a user worklist and don't have the one use restriction for the bitcast (e.g.  PointerReplacer::collectUsers)


================
Comment at: llvm/test/Transforms/SROA/select-load.ll:35
+  ret <2 x i16> %v2
+}
----------------
Should have testcase with multiple users for the bitcast


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106667



More information about the llvm-commits mailing list