[PATCH] D139109: [LoopUnswitch] Perform loop unswitching on select instructions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 4 23:22:11 PST 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:3104
+  if (auto *SI = dyn_cast<SelectInst>(Best.TI))
+    Best.TI = turnSelectIntoBranch(SI, DT, LI, MSSAU);
+  else if (isGuard(Best.TI))
----------------
It is not an equivalent transform in sense of UB. If the condition was posion, then select by this condition is also poison. If you turn it into a branch, branch by poisoned condition is immediate UB. How do you account for that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139109



More information about the llvm-commits mailing list