[LLVMdev] Generating instruction bundles ?

Stephane Marchesin marchesin at icps.u-strasbg.fr
Thu Sep 25 09:58:26 PDT 2008


On Thu, Sep 25, 2008 at 5:59 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>
> On Sep 25, 2008, at 6:51 AM, Stephane Marchesin wrote:
>
>
> LLVM codegen is missing some pieces for wide machines. So you should
> expect to roll up your sleeves and write your own. :-)

Yeah, I'm not sure if that could be tackled by a newcomer though...

>
> I am not sure if I completely understand the description. Is an
> instruction bundle made up of fixed number operations?

Well, the bundle has one "major" operation (add, mul, mad...) and a
couple of "additional" operations that will modify the inputs/outputs
of the major operation. It's not exactly VLIW in that the additional
operations don't change the value of a register, but instead change
the inputs and outputs of the major operation. Or to put it
differently, you could see the additional operations as some kind of
data routing to and from the major operation.

And yes, there is always exactly one major operation, and there are
bits allocated for each of the additional operations for each
input/output. So you can do abs+neg+shuffle on all inputs and scaling
on the output, and the instruction is still 128 bit.

> If so, you
> could model each operation as a separate machine instruction. You can
> add a "bundle formation" (using e.g. bottom up greedy or clustering
> technique) pass to reorder instructions to form the bundles.

Yes, that's the second point I had in mind. That solution is becoming
increasingly interesting to me since I don't think I can tackle
modifying llvm overnight :)

Stephane



More information about the llvm-dev mailing list