[PATCH] D144671: [InstCombine] prevent miscompiles from select-of-div/rem transform

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 09:11:02 PST 2023


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:440
+  if (BO && BO->isIntDivRem() && !isGuaranteedNotToBePoison(Cond))
+    Cond = Builder.CreateFreeze(Cond);
+
----------------
aqjune wrote:
> Should we avoid introducing freeze if `MatchIsOpZero` is false and the op is `udiv`/`urem`?
Sure, we can refine the check.


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

https://reviews.llvm.org/D144671



More information about the llvm-commits mailing list