Commit 5c92f23
authored
[WebAssembly] Fix MIR printing of reference types (llvm#113028)
When printing a memory operand in MIR, this line
https://github.com/llvm/llvm-project/blob/d37bc32a65651e647148236ffb9728ea2e77eac3/llvm/lib/CodeGen/MachineOperand.cpp#L1247
calls this
https://github.com/llvm/llvm-project/blob/d37bc32a65651e647148236ffb9728ea2e77eac3/llvm/include/llvm/Support/Alignment.h#L238
which assumes `Rhs` (the size in this case) is positive.
But Wasm reference types' size is set to 0:
https://github.com/llvm/llvm-project/blob/d37bc32a65651e647148236ffb9728ea2e77eac3/llvm/include/llvm/CodeGen/ValueTypes.td#L326-L328
`getSize() > 0` condition was added with the Wasm reference types
support in
llvm@46667a1,
and it looks it was removed in llvm#84751. This revives the condition so
that Wasm reference types will not crash the MIR printer.1 parent 71792dc commit 5c92f23
File tree
2 files changed
+5
-1
lines changed- llvm
- lib/CodeGen
- test/CodeGen/WebAssembly
2 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1244 | 1244 | | |
1245 | 1245 | | |
1246 | 1246 | | |
1247 | | - | |
| 1247 | + | |
| 1248 | + | |
1248 | 1249 | | |
1249 | 1250 | | |
1250 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
0 commit comments