[llvm] [llvm][CodeGen] respect booleanVectorContents while UnrollVSETCC (NFC) (PR #97589)

Yingchi Long via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 08:37:24 PDT 2024


================
@@ -2016,7 +2016,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),
----------------
inclyc wrote:

> But this isn't NFC and we definitely need test coverage

As I explained above the condition to coverage this code is:

1. The target support vector types, e.g. `<4 x i64>`. (Otherwise, `<4 x i64>` will be expanded first).
2. But it cannot do comparison between that type. (Must be unrolled)

However after running all llvm regression tests I cannot find such target. 

Could you give me some clue about how to test it?

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


More information about the llvm-commits mailing list