Skip to content

Commit

Permalink
Update tests for new intrinsic signature
Browse files Browse the repository at this point in the history
  • Loading branch information
VoxSciurorum committed Oct 22, 2023
1 parent 900fd66 commit 998b11d
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion clang/test/Cilk/hyper-array-extern-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int read_array_hyper(unsigned i)
{
return x[i];
// CHECK: %[[ARRAYIDX:.+]] = getelementptr inbounds
// CHECK: %[[VIEWRAW:.+]] = call ptr @llvm.hyper.lookup.i64(ptr %[[ARRAYIDX]], i64 4, ptr null, ptr null)
// CHECK: %[[VIEWRAW:.+]] = call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[ARRAYIDX]], i64 4, ptr null, ptr null)
// CHECK-NOT: call ptr @llvm.hyper.lookup
// CHECK: %[[VAL:.+]] = load i32, ptr %[[VIEWRAW]]
// CHECK: ret i32 %[[VAL]]
Expand Down
14 changes: 7 additions & 7 deletions clang/test/Cilk/hyper-assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ extern long _Hyperobject x, _Hyperobject y;

long chain_assign()
{
// CHECK: %[[Y1RAW:.+]] = call ptr @llvm.hyper.lookup.i64(ptr @y, i64 8, ptr null, ptr null)
// CHECK: %[[Y1RAW:.+]] = call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @y, i64 8, ptr null, ptr null)
// CHECK: %[[Y1VAL:.+]] = load i64, ptr %[[Y1RAW]]
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 8, ptr null, ptr null)
// CHECK: store i64 %[[Y1VAL]]
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @y, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @y, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 8, ptr null, ptr null)
return x = y = x = y;
}

long simple_assign(long val)
{
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 8, ptr null, ptr null)
// CHECK-NOT: call ptr @llvm.hyper.lookup
// CHECK: store i64
return x = val;
Expand All @@ -26,11 +26,11 @@ long simple_assign(long val)
long subtract()
{
// The order is not fixed here.
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @y, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @y, i64 8, ptr null, ptr null)
// CHECK: load i64
// CHECK: add nsw i64 %[[Y:.+]], 1
// CHECK: store i64
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 8, ptr null, ptr null)
// CHECK: load i64
// CHECK: sub nsw
// CHECK: store i64
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Cilk/hyper-complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern __complex__ float _Hyperobject c;
// CHECK-LABEL: get_real
float get_real()
{
// CHECK: %[[RAW1:.+]] = call ptr @llvm.hyper.lookup.i64(ptr @c, i64 8, ptr null, ptr null)
// CHECK: %[[RAW1:.+]] = call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @c, i64 8, ptr null, ptr null)
// CHECK: %[[FIELD1:.+]] = getelementptr inbounds { float, float }, ptr %[[RAW1]], i32 0, i32 0
// CHECK: %[[RET1:.+]] = load float, ptr %[[FIELD1]]
// CHECK: ret float %[[RET1]]
Expand All @@ -16,7 +16,7 @@ float get_real()
// CHECK-LABEL: get_imag
float get_imag()
{
// CHECK: %[[RAW2:.+]] = call ptr @llvm.hyper.lookup.i64(ptr @c, i64 8, ptr null, ptr null)
// CHECK: %[[RAW2:.+]] = call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @c, i64 8, ptr null, ptr null)
// CHECK: %[[FIELD2:.+]] = getelementptr inbounds { float, float }, ptr %[[RAW2]], i32 0, i32 1
// CHECK: load float, ptr %[[FIELD2]]
// CHECK: ret float
Expand All @@ -27,7 +27,7 @@ float get_imag()
float get_abs()
{
// Only one call to llvm.hyper.lookup.
// CHECK: @llvm.hyper.lookup.i64(ptr @c, i64 8, ptr null, ptr null)
// CHECK: @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @c, i64 8, ptr null, ptr null)
// CHECK-NOT: @llvm.hyper.lookup
// CHECK: call float @cabsf
// CHECK: ret float
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Cilk/hyper-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ extern struct S b __attribute__((aligned(8)));
// CHECK-LABEL: scopy
void scopy()
{
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @a, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @a, i64 8, ptr null, ptr null)
// CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 @b,
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @a, i64 8, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @a, i64 8, ptr null, ptr null)
// CHECK: call void @llvm.memcpy.p0.p0.i64
// CHECK: ret void
b = a;
Expand Down
3 changes: 2 additions & 1 deletion clang/test/Cilk/hyper-template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ template<typename T> struct S { T member; };
S<long> _Hyperobject S_long;

// CHECK-LABEL: @_Z1fv
// CHECK: %0 = call ptr @llvm.hyper.lookup.i64(ptr @S_long, i64 8, ptr null, ptr null)
// CHECK: %0 = call ptr @llvm.tapir.frame()
// CHECK: %1 = call ptr @llvm.hyper.lookup.i64(ptr %0, ptr @S_long, i64 8, ptr null, ptr null)
// CHECK-NOT: call ptr @llvm.hyper.lookup
// CHECK: getelementptr
// CHECK: %[[RET:.+]] = load i64
Expand Down
18 changes: 9 additions & 9 deletions clang/test/Cilk/hyper-unary.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ void function1()
{
// CHECK: store i32 1, ptr %[[Y:.+]],
int _Hyperobject y = 1;
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 4, ptr null, ptr null)
// CHECK: load i32
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: load i32
(void)x; (void)y;
}
Expand All @@ -23,9 +23,9 @@ void function2()
{
// CHECK: store i32 1, ptr %[[Y:.+]],
int _Hyperobject y = 1;
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 4, ptr null, ptr null)
// CHECK: load i32
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: load i32
(void)!x; (void)!y;
}
Expand All @@ -35,18 +35,18 @@ void function3()
{
// CHECK: store i32 1, ptr %[[Y:.+]],
int _Hyperobject y = 1;
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 4, ptr null, ptr null)
// CHECK: load i32
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: load i32
(void)-x; (void)-y;
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr @x, i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr @x, i64 4, ptr null, ptr null)
// CHECK: load i32
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[Y]], i64 4, ptr null, ptr null)
// CHECK: load i32
(void)~x; (void)~y;
// CHECK: %[[XP:.+]] = load ptr, ptr @xp
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %[[XP]], i64 4, ptr null, ptr null)
// CHECK: call ptr @llvm.hyper.lookup.i64(ptr %{{[0-9]+}}, ptr %[[XP]], i64 4, ptr null, ptr null)
// CHECK: load i32
(void)*xp;
}
6 changes: 3 additions & 3 deletions llvm/test/Transforms/Tapir/157.ll
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pfor.cond: ; preds = %pfor.inc, %pfor.ph
pfor.body: ; preds = %pfor.cond
%2 = load i64, i64* %add.ptr, align 8, !tbaa !4
%3 = bitcast i64* %sum to i8*
%4 = call i8* @llvm.hyper.lookup(i8* nonnull %3, i64 8, i8* bitcast (void (i8*)* @zero to i8*), i8* bitcast (void (i8*, i8*)* @plus to i8*))
%4 = call i8* @llvm.hyper.lookup(ptr null, i8* nonnull %3, i64 8, i8* bitcast (void (i8*)* @zero to i8*), i8* bitcast (void (i8*, i8*)* @plus to i8*))
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5, align 8, !tbaa !4
%add = add nsw i64 %6, %2
Expand All @@ -52,7 +52,7 @@ pfor.cond.cleanup: ; preds = %pfor.inc

pfor.end: ; preds = %entry, %pfor.cond.cleanup
%7 = bitcast i64* %sum to i8*
%8 = call i8* @llvm.hyper.lookup(i8* nonnull %7, i64 8, i8* bitcast (void (i8*)* @zero to i8*), i8* bitcast (void (i8*, i8*)* @plus to i8*))
%8 = call i8* @llvm.hyper.lookup(ptr null, i8* nonnull %7, i64 8, i8* bitcast (void (i8*)* @zero to i8*), i8* bitcast (void (i8*, i8*)* @plus to i8*))
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9, align 8, !tbaa !4
%11 = bitcast i64* %sum to i8*
Expand Down Expand Up @@ -92,7 +92,7 @@ declare void @llvm.reducer.register.i64(i8*, i64, i8*, i8*) #2
declare token @llvm.syncregion.start() #3

; Function Attrs: hyper_view inaccessiblememonly injective mustprogress nofree nounwind readonly strand_pure willreturn
declare i8* @llvm.hyper.lookup(i8*, i64, i8*, i8*) #4
declare i8* @llvm.hyper.lookup(i8 *, i8*, i64, i8*, i8*) #4

; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/Transforms/Tapir/loop-stripmine-epilog-taskframe.ll
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ det.achd: ; preds = %pfor.body
%sum_racy.0.load = load i64, i64* %sum_racy, align 8
%add5 = add nsw i64 %sum_racy.0.load, %4
store i64 %add5, i64* %sum_racy, align 8, !tbaa !7
%5 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%5 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6, align 8, !tbaa !7
%add7 = add nsw i64 %7, %4
store i64 %add7, i64* %6, align 8, !tbaa !7
%8 = load i64, i64* %add.ptr.i, align 8, !tbaa !7
%9 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%9 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10, align 8, !tbaa !7
%sub9 = sub nsw i64 %11, %8
Expand All @@ -231,13 +231,13 @@ det.cont: ; preds = %det.achd, %pfor.bod
%sum_racy.0.load91 = load i64, i64* %sum_racy, align 8
%add11 = add nsw i64 %sum_racy.0.load91, %12
store i64 %add11, i64* %sum_racy, align 8, !tbaa !7
%13 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%13 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14, align 8, !tbaa !7
%add13 = add nsw i64 %15, %12
store i64 %add13, i64* %14, align 8, !tbaa !7
%16 = load i64, i64* %add.ptr.i79, align 8, !tbaa !7
%17 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%17 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%18 = bitcast i8* %17 to i64*
%19 = load i64, i64* %18, align 8, !tbaa !7
%sub15 = sub nsw i64 %19, %16
Expand Down Expand Up @@ -289,10 +289,10 @@ sync.continue21: ; preds = %pfor.cond.cleanup
to label %cleanup unwind label %lpad17.loopexit.split-lp

cleanup: ; preds = %sync.continue21, %entry
%21 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%21 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %0, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%22 = bitcast i8* %21 to i64*
%23 = load i64, i64* %22, align 8, !tbaa !7
%24 = call i8* @llvm.hyper.lookup.i64(i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%24 = call i8* @llvm.hyper.lookup.i64(ptr null, i8* nonnull %1, i64 8, i8* bitcast (void (i8*)* @_ZN4cilkL4zeroIlEEvPv to i8*), i8* bitcast (void (i8*, i8*)* @_ZN4cilkL4plusIlEEvPvS1_ to i8*))
%25 = bitcast i8* %24 to i64*
%26 = load i64, i64* %25, align 8, !tbaa !7
%sum_racy.0.load92 = load i64, i64* %sum_racy, align 8
Expand Down Expand Up @@ -467,7 +467,7 @@ declare void @llvm.reducer.register.i64(i8*, i64, i8*, i8*) #11
declare token @llvm.syncregion.start() #12

; Function Attrs: hyper_view inaccessiblememonly injective mustprogress nofree nounwind readonly strand_pure willreturn
declare i8* @llvm.hyper.lookup.i64(i8*, i64, i8*, i8*) #13
declare i8* @llvm.hyper.lookup.i64(i8*, i8*, i64, i8*, i8*) #13

; Function Attrs: argmemonly mustprogress willreturn
declare void @llvm.sync.unwind(token) #14
Expand Down

0 comments on commit 998b11d

Please sign in to comment.