[llvm] [AMDGPU][CFI] Replace CFA expression escapes with typed directives (PR #221011)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 10:53:23 PDT 2026


https://github.com/slinder1 requested changes to this pull request.

Looking at the implementation, it seems like it might make more sense to just add one formulaic operation:

```
.cfi_llvm_def_cfa_linear register, scale, constant

Define the CFA as `register * scale + constant`

For a constant value, use `.cfa_llvm_def_cfa_linear $noreg, 0, <constant>
For a purely scaled value, use `.cfa_llvm_def_cfa_linear <register>, <scale>, 0
```

Even if we don't collapse them, I think the scaled version should *not* be in terms of a factor-of-2 scale explicitly, it should just "strength reduce" to shifts when it sees a factor of 2 scale

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


More information about the llvm-commits mailing list