[llvm] [AMDGPU] Make ubsan happy (PR #68959)
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 13 00:13:39 PDT 2023
https://github.com/rampitec created https://github.com/llvm/llvm-project/pull/68959
None
>From 928a0b205e737b73311fea45e22f32de202f11ee Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
Date: Fri, 13 Oct 2023 00:10:49 -0700
Subject: [PATCH] [AMDGPU] Make ubsan happy
---
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index e16fed445b9f968..fa651b9fcb05a5b 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -2243,7 +2243,8 @@ void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst, int64_t Val, bool ApplyMo
return;
}
- Val = AMDGPU::isSISrcFPOperand(InstDesc, OpNum) ? Val << 32 : Lo_32(Val);
+ Val = AMDGPU::isSISrcFPOperand(InstDesc, OpNum) ? (uint64_t)Val << 32
+ : Lo_32(Val);
Inst.addOperand(MCOperand::createImm(Val));
setImmKindLiteral();
More information about the llvm-commits
mailing list