[llvm] [LoongArch] Add patterns for vstelm instructions (PR #139201)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 15 21:46:32 PDT 2025
================
@@ -140,7 +140,48 @@ bool LoongArchRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
bool FrameRegIsKill = false;
- if (!isInt<12>(Offset.getFixed())) {
+ int FixedOffset = Offset.getFixed();
+ bool OffsetLegal = true;
+
+ // Handle offsets that exceed the immediate range of the instruction.
+ switch (MIOpc) {
+ case LoongArch::VSTELM_B:
+ case LoongArch::XVSTELM_B: {
+ OffsetLegal = isInt<8>(FixedOffset);
+ break;
+ }
----------------
heiher wrote:
We prefer to omit the inner braces to avoid unnecessary line noise.
https://github.com/llvm/llvm-project/pull/139201
More information about the llvm-commits
mailing list