Skip to content
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

[AMDGPU] Fix missing IsExact flag when expanding vector binary operator #86712

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

shiltian
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 26, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp (+3)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
index bddf3d958a1ae6..b8ac81f1316721 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -1594,6 +1594,9 @@ bool AMDGPUCodeGenPrepareImpl::visitBinaryOperator(BinaryOperator &I) {
           }
         }
 
+        if (auto *NewEltI = dyn_cast<Instruction>(NewElt))
+          NewEltI->setIsExact(I.isExact());
+
         NewDiv = Builder.CreateInsertElement(NewDiv, NewElt, N);
       }
     } else {

@shiltian
Copy link
Contributor Author

I'll update the test case in #83155 once that patch is landed to test this patch.

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.

Missing test

@arsenm
Copy link
Contributor

arsenm commented Mar 27, 2024

I'll update the test case in #83155 once that patch is landed to test this patch.

The code is already tested, just add a case with exact

@shiltian
Copy link
Contributor Author

I'll update the test case in #83155 once that patch is landed to test this patch.

The code is already tested, just add a case with exact

Done.

Copy link
Contributor

@jayfoad jayfoad left a comment

Choose a reason for hiding this comment

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

LGTM

@shiltian shiltian merged commit 0a43ca7 into llvm:main Mar 27, 2024
3 of 4 checks passed
@shiltian shiltian deleted the isexact branch March 27, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants