[llvm] [RISCV][GISEL] Legalize, regbank select, and instruction select G_ZEXT, G_SEXT, G_ANYEXT, G_SPLAT_VECTOR, and G_ICMP (PR #85938)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 12:20:29 PDT 2024


================
@@ -229,6 +236,9 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
 
   getActionDefinitionsBuilder(G_ICMP)
       .legalFor({{sXLen, sXLen}, {sXLen, p0}})
+      .legalIf(all(typeIsLegalBoolVec(0, BoolVecTys, ST),
+                   typeIsLegalIntOrFPVec(1, IntOrFPVecTys, ST)))
+      .widenScalarOrEltToNextPow2OrMinSize(1, 8)
----------------
michaelmaitland wrote:

The description says

> Widen the scalar to the next power of two that is at least MinSize. No effect if the type is not a scalar or is a power of two.

I took

> no effect if the type is not a ... power of two

to mean that exactly that.

I think you took it as

> no effect if the type is not a .. power of two or at least MinSize

I will check how it actually works.

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


More information about the llvm-commits mailing list