[PATCH] D149198: [DAGCombiner] Make it so that `udiv` can be folded with `(select c, NonZero, 1)`

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 14:53:11 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2391
+  // We can't hoist all instructions because of immediate UB (not speculatable).
+  // For example div/rem by zero.
+  if (!DAG.isSafeToSpeculativelyExecuteNode(N))
----------------
xbolva00 wrote:
> but UREM is not handled above..
Well the comment still holds true, but indeed could include `urem` in this patch. Will update.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149198



More information about the llvm-commits mailing list