llvm-project
f621b651 - Support scalable offset in CFI.

Commit
144 days ago
Support scalable offset in CFI. Currently, targets with scalable vectors (AArch64, RISCV) handle scalable offsets in cfi using cfi_escape expression. The problem is that CFIInstrInserter doesn't understand these expressions. We define new "pseudo" cfi instructions to support scalable offsets in CFI: (1) llvm_def_cfa_reg_scalable_offset - creates the new rule for calculating cfa: `deref(Reg + ScalableOffset * x + FixedOffset)` where `x` is the "scale" runtime constant. (2) llvm_reg_at_scalable_offset_from_cfa - creates the new rule to calculate previoius value of register `deref(cfa + ScalableOffset * x + FixedOffset)` where `x` is the "scale" runtime constant. (3) llvm_reg_at_scalable_offset_from_reg - creates the new rule to calculate previous value of register `deref(Reg2 + ScalableOffset * x + FixedOffset)`. This rule is to be used when offset from cfa is not known, but intead fixed offset from `Reg2` is known. All of these cfi_instructions will be "lowered" to escape expressions during final assembly emission. But during `CFIInstrInserter` these are not lowered yet, so their semantics can be understood without decoding cfi expressions. Since (1) and (2) depend on how target calculates scalable offsets, their lowering is target-dependent.
Author
Mikhail Gudim
Committer
Parents
Loading