[llvm] [AMDGPU] Fix missing `IsExact` flag when expanding vector binary operator (PR #86712)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 11:47:54 PDT 2024


https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/86712

None

>From 6a4406f6499486e3b808e411315c2262d80fa848 Mon Sep 17 00:00:00 2001
From: Shilei Tian <i at tianshilei.me>
Date: Tue, 26 Mar 2024 14:27:31 -0400
Subject: [PATCH] [AMDGPU] Fix missing `IsExact` flag when expanding vector
 binary operator

---
 llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp | 3 +++
 1 file changed, 3 insertions(+)

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 {



More information about the llvm-commits mailing list