Skip to content

Commit

Permalink
Update LLVM (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjodinchr authored Apr 19, 2024
1 parent 8cb89a7 commit 69e5c0b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"subrepo" : "llvm/llvm-project",
"branch" : "main",
"subdir" : "third_party/llvm",
"commit" : "ea3d0db130b9a6c4678c11dd8bc48e5630624b62"
"commit" : "0a8cd1ed1f4f35905df318015b0dbcb69d81d7c2"
},
{
"name" : "SPIRV-Headers",
Expand Down
7 changes: 5 additions & 2 deletions lib/LongVectorLoweringPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,11 @@ void clspv::LongVectorLoweringPass::cleanDeadFunctions() {
Progress = (DeadFunctions.size() < PreviousSize);
}

assert(DeadFunctions.empty() &&
"Not all supposedly-dead functions were removed!");
// TODO: uncomment assert.
// LLVM now creates some addrspacecast on function that are never used in any
// function. It prevents supposedly-dead functions from being removed
// assert(DeadFunctions.empty() &&
// "Not all supposedly-dead functions were removed!");
}

void clspv::LongVectorLoweringPass::cleanDeadGlobals() {
Expand Down
5 changes: 4 additions & 1 deletion lib/UndoByvalPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ PreservedAnalyses clspv::UndoByvalPass::run(Module &M,
// Update caller site.
for (auto User : Users) {
// Create new call instruction for new function without byval.
CallInst *Call = cast<CallInst>(User);
CallInst *Call = dyn_cast<CallInst>(User);
if (Call == nullptr) {
continue;
}
auto Callee = Call->getCalledFunction();

SmallVector<Value *, 8> Args;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
// CHECK-NOT: OpFunctionCall
// CHECK: OpFunctionEnd

__attribute__((noinline))
int func_3(local int *in, int n) { return in[n]; }
__attribute__((noinline))
int func_2(local int *in, int n) { return func_3(in, n); }
__attribute__((noinline))
int func_1(local int *in, int n) { return func_2(in, n); }
Expand Down
2 changes: 1 addition & 1 deletion test/WrapKernel/wrap_kernel.cl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kernel void main_kernel(global int* C, global int* D) {

// CHECK: [[extinst:%[a-zA-A0-9_]+]] = OpExtInstImport "NonSemantic.ClspvReflection.5"
// CHECK-DAG: [[kernel_add_name:%[a-zA-Z0-9_]+]] = OpString "add"
// CHECK: [[attributes:%[^ ]+]] = OpString "__attribute__((work_group_size_hint(1, 1, 1)))__attribute__((reqd_work_group_size(1, 1, 1))) __kernel"
// CHECK: [[attributes:%[^ ]+]] = OpString "__attribute__((work_group_size_hint(1, 1, 1)))__attribute__((reqd_work_group_size(1, 1, 1)))__kernel"
// CHECK-DAG: [[k0arg0:%[a-zA-Z0-9_]+]] = OpString "A"
// CHECK-DAG: [[k0arg1:%[a-zA-Z0-9_]+]] = OpString "B"
// CHECK-DAG: [[kernel_main_name:%[a-zA-Z0-9_]+]] = OpString "main_kernel"
Expand Down
2 changes: 1 addition & 1 deletion test/kernel_attributes.cl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: spirv-dis %t.spv -o %t.spvasm
// RUN: FileCheck %s < %t.spvasm

// CHECK: [[attributes:%[^ ]+]] = OpString "__attribute__((work_group_size_hint(1, 1, 1)))__attribute__((reqd_work_group_size(1, 1, 1)))__attribute__((vec_type_hint(uchar2))) __kernel"
// CHECK: [[attributes:%[^ ]+]] = OpString "__attribute__((work_group_size_hint(1, 1, 1)))__attribute__((reqd_work_group_size(1, 1, 1)))__attribute__((vec_type_hint(uchar2)))__kernel"
// CHECK: OpExtInst %void {{.*}} Kernel {{.*}} {{.*}} {{.*}} {{.*}} [[attributes]]

__attribute__((work_group_size_hint(1,1,1)))
Expand Down

0 comments on commit 69e5c0b

Please sign in to comment.