[PATCH] D72303: [BranchAlign] Compiler support for suppressing branch align

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 13:29:51 PST 2020


reames created this revision.
reames added reviewers: skan, annita.zhang, jyknight, craig.topper, MaskRay, LuoYuanke.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: LLVM.

As discussed heavily in the original review (D70157 <https://reviews.llvm.org/D70157>), there's a need for the compiler to be able to selective suppress padding (either nop or prefix) to respect assumptions about the meaning of labels and instructions in generated code.

This patch builds on the preliminary syntax used in D71315 <https://reviews.llvm.org/D71315> (which we know will change) and adds the appropriate suppressions into the compiler.  To my knowledge, this covers all cases mentioned to date for clang/JIT support.

I'd like to go ahead and add compiler support for this, even though we haven't finalized assembler syntax.  Doing that makes testing a bit tricky though.  I see two major options:

1. Land draft assembler syntax and change it later.  If we disabled parsing by default, required a unlock flag, and used an obviously ugly name, I think this is reasonable.
2. Write all the tests with disassembly of output from the integrated assembler and don't support any syntax at all.  This is tedious and quite error prone.

I'd like to go ahead with (1), but wanted to make sure others were on board with that before moving forward.

The other major question is how to enable.  For the moment, I'm phrased the patch as if we're going to make this default on the effected cpus (only).  I think that's entirely reasonable, but it probably deserves to be a separate flag for now, with an enable patch following.  Thoughts?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72303

Files:
  llvm/include/llvm/MC/MCAsmBackend.h
  llvm/include/llvm/MC/MCStreamer.h
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
  llvm/lib/Target/X86/X86AsmPrinter.cpp
  llvm/lib/Target/X86/X86MCInstLower.cpp
  llvm/test/CodeGen/X86/statepoint-no-realign-stack.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72303.236445.patch
Type: text/x-patch
Size: 16067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200106/28968ad9/attachment-0001.bin>


More information about the llvm-commits mailing list