[llvm] Reland "[llvm][AArch64] Copy all operands when expanding BLR_BTI bundle (#78267)" (PR #78719)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 03:33:38 PST 2024


DavidSpickett wrote:

> Is there some reason we can't just change the definition of BLR_BTI so it takes the same operands as BLR? Defining it to take different operands, then rewriting them to the form we want, seems like it's more complicated than necessary.

I think I see what you mean. We don't have custom lowering code for `BL` and `BLR` so why would we need it for these pseudo instructions.

We select how we're going to lower the calls in `AArch64CallLowering::lowerCall`. In there there is a comment:
```
  // Create a temporarily-floating call instruction so we can add the implicit
  // uses of arg registers.
```
Which is exactly what I'm doing here, and RVMARKER does currently. But I cannot see where the arg registers are actually added.

It must happen somewhere otherwise the normal branches wouldn't work., looking for something along the lines of `if known branch types copy....`.

https://github.com/llvm/llvm-project/pull/78719


More information about the llvm-commits mailing list