[llvm] [NVPTX] Set boolean contents to zero-or-one (PR #108969)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 13:16:03 PDT 2024


topperc wrote:

> So it looks like DAGCombiner sees that getSetCCResultType returns v2i1, but then sees that v2i1 type isn't legal.
> 
> Had it not been extended it looks like v2i1 setccs get scalarized by type legalization. Maybe you just need to mark v2i16 SETCC has Expand so LegalizeVectorOps will scalarize it?

Actually just marking it Expand stops the DAGCombiner which checks

```
    if (N0.hasOneUse() && TLI.isOperationLegalOrCustom(ISD::SETCC, VT) &&        
        !TLI.isOperationLegalOrCustom(ISD::SETCC, SVT)) {
```

where VT is v2i16 and SVT is v2i1.

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


More information about the llvm-commits mailing list