Commit 24f04c8
committed
Make TargetLowering::getValueType() virtual to fix <N x ptr(7)> crash
Even though ptr addrspace(7) is rewritten away into more primitive
constructs before reaching SelectionDAG or GlobalISel, we stil
sometimes need to query properties like how many registers it will
require.
We already had an existing workaroung that would map ptr
addrspace(7) (and addrspace(9)) to MVT::{5,6}i32, their ultimate
in-register representations, in overloads of
TargetLowering::getPointerType(DL, AddressSpace).
However, whenever TargetLowering::getValue() tried to construct a
vector VT out of those vector MVTs, the vector constructor would
assert because you can't have a vector of vectors.
This commit solves the crash by manually overriding getValueTy() and
getMemValueType() in the AMDGPU TargetLowering.
This is something of a big hammer, and I'm open to suggestions for a
more precise change.1 parent 9cc7ee1 commit 24f04c8
File tree
4 files changed
+82
-5
lines changed- llvm
- include/llvm/CodeGen
- lib/Target/AMDGPU
- test/Transforms/LoopVectorize/AMDGPU
4 files changed
+82
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1675 | 1675 | | |
1676 | 1676 | | |
1677 | 1677 | | |
1678 | | - | |
1679 | | - | |
| 1678 | + | |
| 1679 | + | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
| |||
1695 | 1695 | | |
1696 | 1696 | | |
1697 | 1697 | | |
1698 | | - | |
1699 | | - | |
| 1698 | + | |
| 1699 | + | |
1700 | 1700 | | |
1701 | 1701 | | |
1702 | 1702 | | |
| |||
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | | - | |
1718 | 1717 | | |
1719 | 1718 | | |
1720 | 1719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1206 | 1241 | | |
1207 | 1242 | | |
1208 | 1243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments