diff options
author | Craig Topper <craig.topper@sifive.com> | 2022-05-31 09:43:43 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2022-05-31 09:50:54 -0700 |
commit | 80c4cf6369459f90e103339fcb9f6767474f478b (patch) | |
tree | d200349641feec530da0bab2729baab99c48d6a3 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 3b5456d5f0d1fbfcdf6f6a18e9adec5e42a560ee (diff) | |
download | llvm-80c4cf6369459f90e103339fcb9f6767474f478b.zip llvm-80c4cf6369459f90e103339fcb9f6767474f478b.tar.gz llvm-80c4cf6369459f90e103339fcb9f6767474f478b.tar.bz2 |
[RISCV] Fix a few corner case bugs in RISCVMergeBaseOffsetOpt::matchLargeOffset
The immediate for LUI is stored as 20-bit unsigned value. We need
to sign extend if after shifting by 12 to match the instruction
behavior.
If we find an LUI+ADDI on RV64, it means the constant isn't a
simm32. If it was, we would have emitted LUI+ADDIW from constant
materialization. Make sure the constant is a simm32 before folding.
This appears to match gcc.
A future patch will add support for LUI+ADDIW on RV64.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions