[LLVMdev] RFC: Machine Instruction Bundle

Evan Cheng evan.cheng at apple.com
Fri Dec 2 15:58:21 PST 2011


On Dec 2, 2011, at 2:44 PM, Jakob Stoklund Olesen wrote:

> 
> On Dec 2, 2011, at 12:40 PM, Evan Cheng wrote:
> 
>>                      ----------------
>>                      |    Bundle  * |   (A MI with special opcode "Bundle")
>>                      ----------------
>>                              |
>>                      ----------------
>>                      |      MI    * |
>>                      ----------------
>>                              |
>>                      ----------------
>>                      |      MI    * |
>>                      ----------------
>>                              |
>>                      ----------------
>>                      |      MI      |    (no bit, this is the end of the bundle)
>>                      --------------
>>                              |
>>                      ----------------
>>                      |    Bundle  * |   (a new bundle)
>>                      ----------------
>>                              |
>>                      ----------------
>>                      |      MI    * | 
>>                      ----------------
>>                              |
>>                      ----------------
>>                      |      MI      |
>>                      ----------------
>>                              |
>>                             ...
> 
> I think you should turn the glue bit upside down, so it means "This instruction is glued to its predecessor" instead of "This instruction is glued to its successor. That way, the inner bundled instructions have the glue bit, while the outer bundle headers and unbundled instructions don't.
> 
> That should make your iterator a lot simpler when you have mixed bundles and unbundled MIs. It simply skips MIs with the glue bit set:
> 
>              |       ----------------
>              |-->    |    Bundle    |    (A MI with special opcode "Bundle")
>              |       ----------------
>              |               |
>              |       ----------------
>              |       |      MI    * |
>              |       ----------------
>              |               |
>              |       ----------------
>              |       |      MI    * |    (last MI in bundle)
>              |       ----------------
>              |               |
>              |       ----------------
>              |-->    |      MI      |    (no bit, this is a top-level unbundled MI)
>              |       ----------------
>              |               |
>              |       ----------------
>              |-->    |      MI      |    (unbundled MI)
>              |       ----------------
>              |               |
>              |       ----------------
>              |-->    |    Bundle    |   (a new bundle)
>              |       ----------------
>              |               |
>              |       ----------------
>              |       |      MI    * | 
>              |       ----------------
>              |               |
>              |       ----------------
>              |       |      MI    * |
>              |       ----------------
>              |               |

Ok. Makes sense.

> 
> What happens when you assign a bundled MI* to a MachineBasicBlock::iterator? Does it rewind to the bundle header? There is a lot of code that treats the two as almost equivalent.

That's invalid. If you use the "top level MIs only" iterator, then it's not legal to assign it to a bundled instruction.

Evan

> 
> /jakob
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111202/761c107e/attachment.html>


More information about the llvm-dev mailing list