================
@@ -412,8 +420,20 @@ bool LoongArchMergeBaseOffsetOpt::foldLargeOffset(
       MachineOperand ImmOp = Curr->getOperand(2);
       if (ImmOp.getTargetFlags() != LoongArchII::MO_None || !Hi12)
         return false;
-      Offset += ImmOp.getImm() << 52;
-      Mask &= ~0xFFF0000000000000ULL;
+      const int64_t Imm = ImmOp.getImm();
+      Offset += (static_cast<uint64_t>(Imm) << 52) << Shift;
+      Mask &= ~(0xFFF0000000000000ULL << Shift);
+      Reg = Curr->getOperand(1).getReg();
+      Instrs.push_back(Curr);
+      break;
+    }
+    case LoongArch::SLLI_D: {
----------------
CSharperMantle wrote:

Should be addressed by now. The codegen should be identical to baseline without 
the folding budget increase.

https://github.com/llvm/llvm-project/pull/242357
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to