Commit d7a28f7
committed
[RISCV] Add asserts for insert/extract_subvector invariants. NFC
We can currently select insert_subvector and extract_subvector nodes in RISCVISelDAGToDAG (this is after custom legalizing in RISCVISelLowering) with fixed subvector types. However decomposeSubvectorInsertExtractToSubRegs is based off of scalable subvectors where the indices are scaled by vscale, so any index other than 0 will be wrong. For insert_subvector the vector being inserted into needs to be undef as well, because it assumes we can replace a whole subregister which isn't always the case for fixed subvectors (e.g. insert <2 x i32> into <4 x i32> at index 0 with vlen=128). We currently maintain these invariants in RISCVISelLowering, so this adds asserts in RISCVISelDAGToDAG so we don't break them.1 parent 850dde0 commit d7a28f7
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2062 | 2062 | | |
2063 | 2063 | | |
2064 | 2064 | | |
2065 | | - | |
| 2065 | + | |
| 2066 | + | |
2066 | 2067 | | |
| 2068 | + | |
2067 | 2069 | | |
2068 | 2070 | | |
2069 | 2071 | | |
| |||
2115 | 2117 | | |
2116 | 2118 | | |
2117 | 2119 | | |
2118 | | - | |
| 2120 | + | |
| 2121 | + | |
2119 | 2122 | | |
| 2123 | + | |
2120 | 2124 | | |
2121 | 2125 | | |
2122 | 2126 | | |
| |||
0 commit comments