[PATCH] D113894: [x86] Make assembler variant selection work when outputting intel-style asm
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 15 08:25:53 PST 2021
thakis added a comment.
https://reviews.llvm.org/D98276 just moved things around, so I think it's mostly independent of this change.
But it looks like llvm/test/CodeGen/PowerPC/asm-dialect.ll is failing with this if the ppc target is enabled.
Related changes there are https://reviews.llvm.org/rGe21237e59a8e172e4b038c4998411538853d6bc5 and https://reviews.llvm.org/rG266db7fe043f8f29bc76a7242761d35b3e70cd82.
It looks like the only backends that have tests for variants checked in are ppc and x86. It looks like ppc always wants variant 1, while x86 always wants variant 0 for `asm` and always variant 1 for `asm inteldialect`.
It does look like `MAI->getAssemblerDialect()` is generally more used as the dialect for writing. So in general, I think reading it here is incorrect, since variant selection is more a property of the contents of the `asm` string.
So I think the thing to do here is probably to do something like `int AsmPrinterVariant = MMI->getTarget().UnqualifiedInlineAsmVariant();` and add `LLVMTargetMachine::UnqualifiedInlineAsmVariant()` that returns `0` but make it return `1` in PPCTargetMachine.
(https://reviews.llvm.org/rG1e9097e36a7acdcd75a2f8f229275afd33542db3 is also somewhat related.)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113894/new/
https://reviews.llvm.org/D113894
More information about the llvm-commits
mailing list