aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2022-05-26 08:55:47 -0700
committerPhilip Reames <listmail@philipreames.com>2022-05-26 09:44:58 -0700
commitd58cc0839ee5935e649dbbc18c898a8e4bcd6724 (patch)
treeb47395f3c583e376f7a4af59673ca27c5f14f555 /clang/lib/CodeGen/CodeGenModule.h
parenta831ce528fc0fd16734d644e62ae956834276c1b (diff)
downloadllvm-d58cc0839ee5935e649dbbc18c898a8e4bcd6724.zip
llvm-d58cc0839ee5935e649dbbc18c898a8e4bcd6724.tar.gz
llvm-d58cc0839ee5935e649dbbc18c898a8e4bcd6724.tar.bz2
[RISCV] reorganize getFrameIndexReference to reduce code duplication [nfc]
This change reorganizes the majority of frame index resolution into a two strep process. Step 1 - Select which base register we're going to use. Step 2 - Compute the offset from that base register. The key point is that this allows us to share the step 2 logic for the SP case. This reduces the code duplication, and (I think) makes the code much easier to follow. I also went ahead and added assertions into phase 2 to catch errors where we select an illegal base pointer. In general, we can't index from a base register to a stack location if that requires crossing a variable and unknown region. In practice, we have two such cases: dynamic stack realign and var sized objects. Note that crossing the scalable region is fine since while variable, it's a known variability which can be expressed in the offset. Differential Revision: https://reviews.llvm.org/D126403
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions