[clang] [OpenMP] Remove complex reduction variable support (PR #82497)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 21 07:18:24 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Akash Banerjee (TIFitis)

<details>
<summary>Changes</summary>

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.

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


1 Files Affected:

- (modified) clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp (+3-12) 


``````````diff
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:

``````````

</details>


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


More information about the cfe-commits mailing list