[llvm] [GlobalISel] Make the Combiner insert G_FREEZE when converting G_SELECT to binary operations. (PR #82733)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 02:42:58 PST 2024


================
@@ -6523,7 +6525,9 @@ bool CombinerHelper::tryFoldBoolSelectToLogic(GSelect *Select,
       B.setInstrAndDebugLoc(*Select);
       Register Ext = MRI.createGenericVirtualRegister(TrueTy);
       B.buildZExtOrTrunc(Ext, Cond);
-      B.buildAnd(DstReg, Ext, True);
+      Register FreezeTrue = MRI.createGenericVirtualRegister(TrueTy);
+      B.buildFreeze(FreezeTrue, True);
----------------
arsenm wrote:

```suggestion
      auto FreezeTrue = B.buildFreeze(TrueTy, True);
```

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


More information about the llvm-commits mailing list