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

Jim Grosbach grosbach at apple.com
Wed Dec 19 17:03:44 PST 2012


On Dec 19, 2012, at 4:28 PM, Eli Bendersky <eliben at google.com> wrote:

> 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.
> 

Yeah, X86 is why I'm just mildly skeptical rather than downright opposed. It's a pretty compelling case for making the assembler a lot smarter than it otherwise would need to be.

> 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.

That's the philosophical stuff I mentioned earlier. ;)

-Jim



More information about the llvm-commits mailing list