[llvm-commits] PATCH: Aligned bundling support in LLVM MC

Eli Bendersky eliben at google.com
Wed Dec 19 16:28:24 PST 2012


On Wed, Dec 19, 2012 at 4:14 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Hi Eli,
>
> The code all looks fine to me. Pretty excellent, in fact. I'm OK with this going in. If we change our minds (see below question), we can always back out.
>

Thanks for the review Jim, much appreciated. I will commit this within
a day or two.

> I still have a bit of a funny feeling about doing this sort of thing in the assembler at all, though. It really seems it should be done as part of the target back end using alignment directives in the code stream. That ship may have already sailed, though, if we want to keep compatibility w/ GNU's binutils on these sorts of features.

This would be an interesting possibility to discuss. I think it'd be
pretty challenging in the codegen, however, simply because too much
information is unknown. Take x86, for instance. You don't just want to
emit a .align directive for each instruction, but only those that do
indeed cross a bundle boundary. The fact of their crossing said
boundary isn't known before the assembler does its layout. Relaxation
complicates this considerably, because it can ruin your plans if
you've set up everything from up-front. Groups of bundle-locked
instructions are even more challenging - personally I'm not aware of
existing assembler directives that can express the semantics required.

I also think that having this in the assembler is a nice separation of
concerns, allowing it to serve .s code emitted through other means
(i.e. JITed not through LLVM for one reason or another). It leaves the
compiler with the relatively simple tasks of emitting these new
directives when it deems necessary, knowing that the assembler will
implement them correctly.

Eli




More information about the llvm-commits mailing list