================
@@ -133,3 +133,105 @@ void case6(S s) {
   // derived to base conversion in argument passing
   useP(s);
 }
+
+// disabled otherwise the IR will be generated in the wrong order.
+// UTC_ARGS: --disable
+
+struct G {
+  int X;
+  void f() {}
+  void setX(int val) { this.X = val; }
+  int getX() const { return X; }
+};
+
+groupshared G g;
+
+// CHECK-LABEL: define hidden void @_Z5case7v(
+// CHECK-SAME: ) #[[ATTR0]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[TMP0:%.*]] = call token 
@llvm.experimental.convergence.entry()
+// CHECK-NEXT:    [[TMP:%.*]] = alloca [[STRUCT_G:%.*]], align 1
+// CHECK-NEXT:    [[TMP1:%.*]] = alloca [[STRUCT_G]], align 1
+// CHECK-NEXT:    call void @llvm.memcpy.p0.p3.i32(ptr align 1 [[TMP]], ptr 
addrspace(3) align 1 @g, i32 4, i1 false)
+// CHECK-NEXT:    call void @_ZN1G1fEv(ptr noundef nonnull align 1 
dereferenceable(4) [[TMP]]) #[[ATTR3]] [ "convergencectrl"(token [[TMP0]]) ]
+// CHECK-NEXT:    call void @llvm.memcpy.p3.p0.i32(ptr addrspace(3) align 1 
@g, ptr align 1 [[TMP]], i32 4, i1 false)
+// CHECK-NEXT:    call void @llvm.memcpy.p0.p3.i32(ptr align 1 [[TMP1]], ptr 
addrspace(3) align 1 @g, i32 4, i1 false)
----------------
hekota wrote:

Is there a way to not generate this extra `memcpy` here? It looks like it is a 
remnant of the value assignment after the call, but it would be better if it is 
not there.

https://github.com/llvm/llvm-project/pull/229939
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to