From 5ee4740bc864a8aaddb50e8e7a43cb5a18df0fcf Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 12 Aug 2026 02:26:15 +0800 Subject: [RISCV] Legalize G_PTR_ADD with s64 offsets --- backend/lib/Target/RISCV/RISCVCodeGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/lib/Target') diff --git a/backend/lib/Target/RISCV/RISCVCodeGen.cpp b/backend/lib/Target/RISCV/RISCVCodeGen.cpp index 2dd5ee4..d03653f 100644 --- a/backend/lib/Target/RISCV/RISCVCodeGen.cpp +++ b/backend/lib/Target/RISCV/RISCVCodeGen.cpp @@ -3870,8 +3870,8 @@ public: const std::optional Pointer = operandType(Function, Instruction, 1); const std::optional Offset = operandType(Function, Instruction, 2); return Type && Pointer && Offset && Type->isPointer() && Type->addressSpace() == 0 && - Type->scalarBitWidth() == 64 && *Pointer == *Type && Offset->isInteger() && - Offset->scalarBitWidth() == 64 + Type->scalarBitWidth() == 64 && *Pointer == *Type && + isSupportedIntegerScalar(*Offset) && Offset->scalarBitWidth() == 64 ? LegalizationAction::Legal : LegalizationAction::Unsupported; } -- cgit v1.2.3