[llvm] AMDGPU: Change round-mode operand type to i32 for FPTRUNC_ROUND (PR #106424)

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 10:50:07 PDT 2024


https://github.com/changpeng created https://github.com/llvm/llvm-project/pull/106424

  We need this immediate type to be consistent. This is the pre-commit for https://github.com/llvm/llvm-project/pull/105761

>From d2acd858ae79f5256a44ae1feca328118e4b220b Mon Sep 17 00:00:00 2001
From: Changpeng Fang <changpeng.fang at amd.com>
Date: Wed, 28 Aug 2024 10:41:44 -0700
Subject: [PATCH] AMDGPU: Change round-mode operand type to i32 for
 FPTRUNC_ROUND

  We need this immediate type to be consistent.
---
 llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 60dcb118542785..851c646b1cb333 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6957,8 +6957,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
     SDValue Result;
     Result = DAG.getNode(
         ISD::FPTRUNC_ROUND, sdl, VT, getValue(I.getArgOperand(0)),
-        DAG.getTargetConstant((int)*RoundMode, sdl,
-                              TLI.getPointerTy(DAG.getDataLayout())));
+        DAG.getTargetConstant((int)*RoundMode, sdl, MVT::i32));
     setValue(&I, Result);
 
     return;



More information about the llvm-commits mailing list