Skip to content

Commit 48dfaa4

Browse files
authored
Resolve test failures (#17436)
1 parent 0131616 commit 48dfaa4

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,10 +2375,12 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
23752375
llvm::Type *DstTy = ConvertType(DestTy);
23762376

23772377
if (SrcTy->isPointerTy() && DstTy->isPointerTy() &&
2378-
SrcTy->getPointerAddressSpace() != DstTy->getPointerAddressSpace())
2378+
SrcTy->getPointerAddressSpace() != DstTy->getPointerAddressSpace()) {
23792379
Src = Builder.CreateAddrSpaceCast(
23802380
Src,
23812381
llvm::PointerType::get(VMContext, DstTy->getPointerAddressSpace()));
2382+
SrcTy = Src->getType();
2383+
}
23822384

23832385
// FIXME: this is a gross but seemingly necessary workaround for an issue
23842386
// manifesting when a target uses a non-default AS for indirect sret args,

clang/test/CodeGenSYCL/address-space-cond-op.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct S {
2525
// CHECK-NEXT: br label [[COND_END]]
2626
// CHECK: cond.end:
2727
// CHECK-NEXT: [[COND_LVALUE:%.*]] = phi ptr addrspace(4) [ [[TMP1]], [[COND_TRUE]] ], [ [[RHS_ASCAST]], [[COND_FALSE]] ]
28-
// CHECK-NEXT: call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) align 2 [[AGG_RESULT:%.*]], ptr addrspace(4) align 2 [[COND_LVALUE]], i64 2, i1 false)
28+
// CHECK-NEXT: call void @llvm.memcpy.p0.p4.i64(ptr align 2 [[AGG_RESULT:%.*]], ptr addrspace(4) align 2 [[COND_LVALUE]], i64 2, i1 false)
2929
// CHECK-NEXT: ret void
3030
//
3131
S foo(bool cond, S &lhs, S rhs) {

clang/test/CodeGenSYCL/address-space-of-returns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A ret_agg() {
2525
A a;
2626
return a;
2727
}
28-
// CHECK: define {{.*}}spir_func void @{{.*}}ret_agg{{.*}}(ptr addrspace(4) dead_on_unwind noalias writable sret(%struct{{.*}}.A) align 4 %agg.result)
28+
// CHECK: define {{.*}}spir_func void @{{.*}}ret_agg{{.*}}(ptr dead_on_unwind noalias writable sret(%struct{{.*}}.A) align 4 %agg.result)
2929

3030
template <typename name, typename Func>
3131
__attribute__((sycl_kernel)) void kernel_single_task(const Func &kernelFunc) {

clang/test/CodeGenSYCL/nvptx-short-ptr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
// Targeting a 32-bit NVPTX, check that we see universal 32-bit pointers (the
2222
// option changes nothing)
23-
// CHECK32: target datalayout = "e-p:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"
23+
// CHECK32: target datalayout = "e-p:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"
2424

2525
// Targeting a 64-bit NVPTX target, check that we see 32-bit pointers for
2626
// shared (3), const (4), and local (5) address spaces only.
27-
// CHECK64-DEFAULT: target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
28-
// CHECK64-SHORT: target datalayout = "e-p3:32:32-p4:32:32-p5:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"
27+
// CHECK64-DEFAULT: target datalayout = "e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"
28+
// CHECK64-SHORT: target datalayout = "e-p3:32:32-p4:32:32-p5:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"

clang/test/CodeGenSYCL/regcall-cc-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct NonCopyable {
333333
// CHECK-DAG: %struct.NonCopyable = type { i32 }
334334

335335
SYCL_DEVICE int __regcall bar(NonCopyable x) {
336-
// CHECK-DAG: define dso_local x86_regcallcc noundef i32 @_Z15__regcall3__bar11NonCopyable(ptr noundef %x)
336+
// CHECK-DAG: define dso_local x86_regcallcc noundef i32 @_Z15__regcall3__bar11NonCopyable(ptr noundef byval(%struct.NonCopyable) align 4 %x)
337337
return x.a;
338338
}
339339

clang/test/CodeGenSYCL/sycl-intelfpga-bitint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "Inputs/sycl.hpp"
99

10-
// CHECK: define{{.*}} void @_Z3fooDB4096_S_(ptr addrspace(4) {{.*}} sret(i4096) align 8 %agg.result, ptr {{.*}} byval(i4096) align 8 %[[ARG1:[0-9]+]], ptr {{.*}} byval(i4096) align 8 %[[ARG2:[0-9]+]])
10+
// CHECK: define{{.*}} void @_Z3fooDB4096_S_(ptr {{.*}} sret(i4096) align 8 %agg.result, ptr {{.*}} byval(i4096) align 8 %[[ARG1:[0-9]+]], ptr {{.*}} byval(i4096) align 8 %[[ARG2:[0-9]+]])
1111
signed _BitInt(4096) foo(signed _BitInt(4096) a, signed _BitInt(4096) b) {
1212
// CHECK: %a.addr.ascast = addrspacecast ptr %a.addr to ptr addrspace(4)
1313
// CHECK: %b.addr.ascast = addrspacecast ptr %b.addr to ptr addrspace(4)

0 commit comments

Comments
 (0)