[clang] [llvm] OpenMP offload 'simd' directive (PR #91261)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 16:33:59 PDT 2024


================
@@ -1210,12 +1211,16 @@ CallInst *CodeExtractor::emitCallAndSwitchStatement(Function *newFunction,
 
     if (ArgsInZeroAddressSpace && DL.getAllocaAddrSpace() != 0) {
       auto *StructSpaceCast = new AddrSpaceCastInst(
-          Struct, PointerType ::get(Context, 0), "structArg.ascast");
+        Struct, PointerType ::get(Context, 0), "structArg.ascast");
       StructSpaceCast->insertAfter(Struct);
-      params.push_back(StructSpaceCast);
+      // There isn't really a point in generating this cast if you
+      // just aren't going to use it...
+      Struct = StructSpaceCast;
+      //params.push_back(StructSpaceCast);
     } else {
-      params.push_back(Struct);
+      //params.push_back(Struct);
     }
+    params.push_back(Struct);
----------------
jdoerfert wrote:

Most of these changes are unrelated. The question is if we need Struct to be the AS cast or if the AS cast should be in the params. It's hard to see the need if this worked for others before.

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


More information about the llvm-commits mailing list