[PATCH] D116424: [ShrinkWrap] don't sink Save points past INLINEASM_BR MachineInstrs
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 10:47:49 PST 2022
nickdesaulniers added inline comments.
================
Comment at: llvm/lib/CodeGen/ShrinkWrap.cpp:507-511
+ if (MI.getOpcode() == TargetOpcode::INLINEASM_BR) {
+ LLVM_DEBUG(dbgs() << "inlineasm_br prevents shrink-wrapping\n");
+ return false;
+ }
if (!useOrDefCSROrFI(MI, RS.get()))
----------------
nickdesaulniers wrote:
> There's something simpler going on here. The same exact input works as expected for other architectures with link registers, such as `arm` and `aarch64`. It seems that `useOrDefCSROrFI` is returning `true` for the `INLINEASM_BR` for those architectures, but not `powerpc64le`.
In `aarch64` and `arm`, the `MachineOperand` `useOrDefCSROrFI` is interested is marked `dead`, but for `ppc64le` it's not.
`implicit-def dead early-clobber $lr` (arm, aarch64)
`implicit-def early-clobber $lr` (ppc64le)
For `arm` and `aarch64`, the `MachineOperand` is marked dead by the `livevars` pass. For ppc64le, it does not.
---
Also, within `useOrDefCSROrFI`, the call to `RCI.getLastCalleeSavedAlias` returns 0 on ppc, unlike aarch64 and arm.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116424/new/
https://reviews.llvm.org/D116424
More information about the llvm-commits
mailing list