[PATCH] D12456: [IR] Add operand bundles to CallInst and InvokeInst.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 16:08:15 PDT 2015


sanjoy added inline comments.

================
Comment at: include/llvm/IR/Instructions.h:1429
@@ +1428,3 @@
+        unsigned(Args.size()) + CountBundleInputs(Bundles) + 1;
+    const unsigned DescriptorBytes = Bundles.size() * sizeof(BundleOpInfo);
+
----------------
JosephTremoulet wrote:
> Should we pad this to pointer-align the `StringMapEntry<uint32_t> *Tag` field of the `BundleOpInfo`s (and likewise for the other `CallInst::Create` overload and the two `InvokeInst::Create`s)?
Please do check my math, but after this current round of changes, I think the `Tag` field should be aligned.  Now, the layout of a `User` (in 64bit platforms) with a `BundleOpInfo` should be

```
BundleOpInfo[0]    // addr is 8x
  Tag              // addr is 8x
  uint32_t         // addr is 8(x + 1)
  uint32_t         // addr is 8(x + 1) + 4
BundleOpInfo[1]    // addr is 8(x + 2)
  ...
... BundleOpInfo[1, 2, 3] ...
DescriptorInfo     // addr is 8y
  intptr_t         // addr is 8y
Use[]              // addr is 8(y + 1)
  ...
User               // addr is 8(y + 1 + 3 * # uses)
```

For 32 bit platforms, things should roughly stay the same, except the `uint32_t`s will take up one whole word instead.

However, I'm sure if the `Begin` and `End` fields should be `uint32_t`s, instead of being a native `int`.  What do you think?


http://reviews.llvm.org/D12456





More information about the llvm-commits mailing list