[PATCH] D97982: [MC] Introduce NeverAlign fragment type
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 25 22:15:04 PDT 2021
MaskRay added a comment.
This is performance related. I hope folks like @RKSimon @lebedev.ri can comment.
================
Comment at: llvm/include/llvm/MC/MCFragment.h:37
FT_Align,
+ FT_NeverAlign,
FT_Data,
----------------
Perhaps the name should include `X86`? Inserting a one-byte nop isn't something any RISC arch can do.
================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:4733
+/// parseDirectiveAvoidEndAlign
+/// ::= .avoid_end_align alignment
+bool X86AsmParser::parseDirectiveAvoidEndAlign(SMLoc L) {
----------------
Are you using the assembly syntax `.avoid_end_align` in tools? Or is it for testing purpose only?
================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:4737
+ SMLoc AlignmentLoc;
+ const MCSubtargetInfo STI = getSTI();
+ AlignmentLoc = getTok().getLoc();
----------------
Delete
================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:4743
+
+ if (getParser().parseToken(AsmToken::EndOfStatement,
+ "unexpected token in directive"))
----------------
`if (parseEOL())`
================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:4748
+ if (Alignment <= 0) {
+ Error(AlignmentLoc, "directive with non-positive alignment");
+ return false;
----------------
expected a positive alignment
================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:4753
+ getParser().getStreamer().emitNeverAlignCodeAtEnd(Alignment);
+
+ return false;
----------------
delete blank line
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97982/new/
https://reviews.llvm.org/D97982
More information about the llvm-commits
mailing list