llvm-project
5c92f233 - [WebAssembly] Fix MIR printing of reference types (#113028)

Commit
1 year ago
[WebAssembly] Fix MIR printing of reference types (#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 https://github.com/llvm/llvm-project/commit/46667a10039b664b953eb70534c27627b35a267d, and it looks it was removed in #84751. This revives the condition so that Wasm reference types will not crash the MIR printer.
Author
Parents
Loading