Skip to content

DAG: Change round-mode operand type to i32 for FPTRUNC_ROUND #106424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

changpeng
Copy link
Contributor

We need this immediate type to be consistent. This is the pre-commit for #105761

  We need this immediate type to be consistent.
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label Aug 28, 2024
@changpeng changpeng requested a review from arsenm August 28, 2024 17:50
@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2024

@llvm/pr-subscribers-llvm-selectiondag

Author: Changpeng Fang (changpeng)

Changes

We need this immediate type to be consistent. This is the pre-commit for #105761


Full diff: https://github.com/llvm/llvm-project/pull/106424.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (+1-2)
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;

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 25d976b45cb5b3d222d3a9cd94caa8a54031bbb7 d2acd858ae79f5256a44ae1feca328118e4b220b --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 851c646b1c..4a2bd89ff9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6955,9 +6955,9 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
     SelectionDAG::FlagInserter FlagsInserter(DAG, Flags);
 
     SDValue Result;
-    Result = DAG.getNode(
-        ISD::FPTRUNC_ROUND, sdl, VT, getValue(I.getArgOperand(0)),
-        DAG.getTargetConstant((int)*RoundMode, sdl, MVT::i32));
+    Result =
+        DAG.getNode(ISD::FPTRUNC_ROUND, sdl, VT, getValue(I.getArgOperand(0)),
+                    DAG.getTargetConstant((int)*RoundMode, sdl, MVT::i32));
     setValue(&I, Result);
 
     return;

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title is wrong, this is not an AMDGPU change

@changpeng changpeng changed the title AMDGPU: Change round-mode operand type to i32 for FPTRUNC_ROUND [SelectionDAG] Change round-mode operand type to i32 for FPTRUNC_ROUND Aug 28, 2024
@changpeng
Copy link
Contributor Author

Title is wrong, this is not an AMDGPU change
Changed to "SelectionDAG"

@arsenm arsenm changed the title [SelectionDAG] Change round-mode operand type to i32 for FPTRUNC_ROUND DAG: Change round-mode operand type to i32 for FPTRUNC_ROUND Aug 28, 2024
@changpeng changpeng merged commit 41b5507 into llvm:main Aug 28, 2024
6 of 9 checks passed
@changpeng changpeng deleted the i32 branch August 28, 2024 18:16
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Sep 30, 2024
…24ccc2ecf

Local branch amd-gfx 20624cc Merged main:73e0aa58666f235bef091735a5f189882acc1148 into amd-gfx:e64f6fcf29c6
Remote branch main 41b5507 DAG: Change round-mode operand type to i32 for FPTRUNC_ROUND (llvm#106424)
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Feb 3, 2025
…6424)

We need this immediate type to be consistent. This is the pre-commit for
llvm#105761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants