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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 04:30:15 PST 2023


aqjune added inline comments.


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


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

https://reviews.llvm.org/D144671



More information about the llvm-commits mailing list