[PATCH] D71238: Align non-fused branches within 32-Byte boundary (basic case)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 14:37:11 PST 2019


reames added a comment.

In D71238#1777857 <https://reviews.llvm.org/D71238#1777857>, @jyknight wrote:

> > Honestly, I both strongly agree with this, and see the argument as a somewhat lost cause. I think in practical terms, we *will* have to support something which works for both compiler generated assembly and legacy hand written assembly. I dislike that fact and the design it encourages, but it's reality.
>
> Hand-written assembly is generally responsible for its own performance optimizations, and we do not usually expect the assembler to muck around with the code. So, why is it assumed that _this_ optimization should be done automatically on such assembly code?


The more I think about this, the more I think James is right here.

Regardless of whether he is or not, we're clearly going to need an opt in assembler syntax for this at some point.  Given that, I'm wondering if my time wouldn't be better spent there.  The majority of the code would be shared with this patch, and it defers the controversy around optimizing assemblers until later.  If we get that piece done, we can build either compiler or optimizing assembler (or both) support on top.

I've gone as far as writing a rough draft of textual assembler support.  If folks agree this is helpful, I'll abandon this patch, and post one in that direction.  Any high level suggestions as to syntax?  I see two major options, but definitely welcome suggestions w.r.t. naming/semantics/etc...

Option 1

.boundary_align 4
jmp foo

and

.boundary_align 4
.bundle_lock
test ...
jcc foo
.bundle_lock

Option 2

Option 1

.boundary_align 4
jmp foo
.end_boundary_align

and

.boundary_align 4
test ...
jcc foo
.end_boundary_align

p.s. If anyone has a better name than "boundary align" please suggest it.  That's not a good name; it's just a placeholder.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71238/new/

https://reviews.llvm.org/D71238





More information about the llvm-commits mailing list