https://github.com/TIFitis created 
https://github.com/llvm/llvm-project/pull/82497

This patch removes the complex reduction variables codegen. There are currently 
no tests for this, and from playing around with some complex reduction variable 
test cases the code seems unreachable.

The PR #80343 proposes to migrate reductions codegen to the OMPIRBuilder and it 
isn't currently well equipped to handle complex variables. This patch would 
enable PR #80343 to go forward.

>From 9d3e9a44089086fd8528d79709be196123a8d493 Mon Sep 17 00:00:00 2001
From: Akash Banerjee <akash.baner...@amd.com>
Date: Wed, 21 Feb 2024 15:10:43 +0000
Subject: [PATCH] [OpenMP] Remove complex reductions

This patch removes the complex reduction variables codegen. There are currently 
no tests for this, and from playing around with some complex reduction variable 
test cases the code seems unreachable.

The PR #80343 proposes to migrate reductions codegen to the OMPIRBuilder and it 
isn't currently well equipped to handle complex variables. This patch would 
enable PR #80343 to go forward.
---
 clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp 
b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
index 299ee1460b3db0..a954ad0b3a5e2c 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
@@ -1653,12 +1653,7 @@ static void emitReductionListCopy(
         break;
       }
       case TEK_Complex: {
-        CodeGenFunction::ComplexPairTy Elem = CGF.EmitLoadOfComplex(
-            CGF.MakeAddrLValue(SrcElementAddr, Private->getType()),
-            Private->getExprLoc());
-        CGF.EmitStoreOfComplex(
-            Elem, CGF.MakeAddrLValue(DestElementAddr, Private->getType()),
-            /*isInit=*/false);
+        llvm_unreachable("OpenMP Complex reduction not handled.");
         break;
       }
       case TEK_Aggregate:
@@ -2232,9 +2227,7 @@ static llvm::Value *emitListToGlobalCopyFunction(
       break;
     }
     case TEK_Complex: {
-      CodeGenFunction::ComplexPairTy V = CGF.EmitLoadOfComplex(
-          CGF.MakeAddrLValue(ElemPtr, Private->getType()), Loc);
-      CGF.EmitStoreOfComplex(V, GlobLVal, /*isInit=*/false);
+      llvm_unreachable("OpenMP Complex reduction not handled.");
       break;
     }
     case TEK_Aggregate:
@@ -2439,9 +2432,7 @@ static llvm::Value *emitGlobalToListCopyFunction(
       break;
     }
     case TEK_Complex: {
-      CodeGenFunction::ComplexPairTy V = CGF.EmitLoadOfComplex(GlobLVal, Loc);
-      CGF.EmitStoreOfComplex(V, CGF.MakeAddrLValue(ElemPtr, 
Private->getType()),
-                             /*isInit=*/false);
+      llvm_unreachable("OpenMP Complex reduction not handled.");
       break;
     }
     case TEK_Aggregate:

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to