[LLVMdev] RFC: Machine Instruction Bundle
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Dec 2 14:44:25 PST 2011
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 * |
| ----------------
| |
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.
/jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111202/62ce9fd3/attachment.html>
More information about the llvm-dev
mailing list