Fixes PR#48678. X86TargetLowering::getRegForInlineAsmConstraint() can adjust the register class to match the type, e.g. change VR128X to VR256X if the type needs 256 bits. However, the function currently returns the unadjusted register and the adjusted register class, e.g. xmm15 and VR256X, which then causes an assertion failure later because the register class does not contain that register. This patch fixes this behavior.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I'm not sure if this is the right fix. The input somehow looks undefined behavior, which means we don't necessarily follow what's GCC doing. Besides, GCC doesn't handle it well in other case https://godbolt.org/z/6TTEvKvT6
Can we check for this case and simply report error/warning in the front end?
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
54134 ↗ | (On Diff #387046) | Should be better to pass Res directly? |
Comment Actions
I've changed it to issue an error instead now. Is this what you had in mind @pengfei?
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | ||
---|---|---|
8408 | return None ? |
Comment Actions
Thanks again for the review. Can you also commit this for me @pengfei? (The libFuzzer test failure seems unrelated.)
return None ?