[llvm] [LegalizeVectorOps] Use getBoolConstant instead of getAllOnesConstant in VectorLegalizer::UnrollVSETCC. (PR #121526)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 15:15:49 PST 2025


================
@@ -2250,7 +2250,8 @@ SDValue VectorLegalizer::UnrollVSETCC(SDNode *Node) {
                          TLI.getSetCCResultType(DAG.getDataLayout(),
                                                 *DAG.getContext(), TmpEltVT),
                          LHSElem, RHSElem, CC);
-    Ops[i] = DAG.getSelect(dl, EltVT, Ops[i], DAG.getAllOnesConstant(dl, EltVT),
+    Ops[i] = DAG.getSelect(dl, EltVT, Ops[i],
+                           DAG.getBoolConstant(true, dl, EltVT, VT),
                            DAG.getConstant(0, dl, EltVT));
----------------
topperc wrote:

Thanks. I didn't know there was history here. Have any of the yaks been shaved yet?

Still seems like we should either fix the code with getBoolConstant or add a FIXME until we can use getBoolExtOrTrunc. That way the next person who reads this code doesn't think it's wrong like I just did.

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


More information about the llvm-commits mailing list