Details
Diff Detail
Event Timeline
I am not sure what kind of tests I should add for this patch. This is one of the patches needed for adding SEH support to LLVM (D53540).
You can write an MIR test, probably; check the assembly that gets emitted for an instruction like like "renamable $x0 = MOVKXi killed renamable $x0, target-flags(aarch64-g1, aarch64-nc) @a, 16".
Also, you probably need to update AArch64InstrInfo::getSerializableBitmaskMachineOperandTargetFlags .
Yes, I will add tests. Also I see that AArch64MCExpr::VK_NC is not set when AArch64II::MO_NC is set. Will fix this soon.
lib/Target/AArch64/AArch64MCInstLower.cpp | ||
---|---|---|
237 | The problem with setting VK_NC (if MO_NC is set) is that a lot of unit tests fail with the following assert: adrp x0, "??_C@foo@" add x0, x0, Invalid ELF symbol kind UNREACHABLE executed at /local/mnt/workspace/mgrang/comm/src/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp:78! This is because a lot of flags like VK_PAGEOFF/VK_PAGE, etc also have to be set (like LowerSymbolELF does it). I am not sure that should be done in this patch. Should I then restrict setting VK_NC only if one of MO_G3/MO_G2/MO_G1/MO_G0 and MO_NC are set? |
lib/Target/AArch64/AArch64MCInstLower.cpp | ||
---|---|---|
233 | You can declare RefKind with type "auto" since it's obvious here. | |
237 | Ultimately, we should only form an AArch64MCExprs where getKind() returns a known kind (one of the enum values from the list in AArch64MCExpr); otherwise, it's not clear what relocation is being requested. I'm fine guarding it with "if (RefFlags)" or something like that for now (so we VK_NONE for cases you aren't addressing with this patch). Please leave a FIXME; we should clean it up at some point for clarity, but it doesn't need to block this patch. |
lib/Target/AArch64/AArch64MCInstLower.cpp | ||
---|---|---|
203 | Formatting |
Formatting