The InlineAsmLowering was blindly copying the input operands to the selected register class without checking if their sizes match. This resulted in illegal COPYs. Use G_ANYEXT to extend the input operand to fit the selected register class. G_ANYEXT ist used since the inline assembler is not allowed to assume anything about the upper bits of the input operands.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
537–539 | Scratch reg and InputReg are the same thing. You can just use the type as the DstOp to buildAnyExt. This may also be a problem for non-scalar sources. What if you have <2 x i4>? |
Comment Actions
A similar issue (for tied input operands) is handled in https://reviews.llvm.org/D83384
The function introduced there should be extended to handle the vector case.
Comment Actions
In that case I'll hold off on this patch until the one you linked is landed. If that one will introduce the extension handling already, I'll abandon this patch.
Comment Actions
I'll abandon this patch since this was committed in https://reviews.llvm.org/rGfd85b40aee4aa4cfcecaf2bfaf86e1de4c78ab0c
Scratch reg and InputReg are the same thing. You can just use the type as the DstOp to buildAnyExt.
This may also be a problem for non-scalar sources. What if you have <2 x i4>?