[llvm] [RISCV] Insert a freeze before converting select to AND/OR. (PR #84232)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 12:57:12 PST 2024


================
@@ -7274,6 +7274,7 @@ static SDValue combineSelectToBinOp(SDNode *N, SelectionDAG &DAG,
     const APInt &FalseVal = FalseV->getAsAPIntVal();
     if (~TrueVal == FalseVal) {
       SDValue Neg = DAG.getNegative(CondV, DL, VT);
+      FalseV = DAG.getFreeze(FalseV);
----------------
nikic wrote:

This freeze looks unnecessary. If x is poison so is ~x and they're constants here to boot.

https://github.com/llvm/llvm-project/pull/84232


More information about the llvm-commits mailing list