Skip to content

Commit db0ecea

Browse files
authored
[AMDGPU] Fix uncaught changes made by AMDGPUPreloadKernelArgumentsPass (#154645)
#153975 added a new test, `test/CodeGen/AMDGPU/disable-preload-kernargs.ll`, that triggers an assertion under `LLVM_ENABLE_EXPENSIVE_CHECKS` complaining about not invalidating analyses even when the Pass made changes. It was caused by the fact that the Pass only invalidates the analyses when number of explicit arguments is greater than zero, while it is possible that some functions will be removed even when there isn't any explicit argument, hence the missed invalidation.
1 parent ff5f396 commit db0ecea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUPreloadKernelArguments.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ static bool markKernelArgsAsInreg(Module &M, const TargetMachine &TM) {
341341
Changed |= NumPreloadedExplicitArgs > 0;
342342
}
343343

344+
Changed |= !FunctionsToErase.empty();
344345
// Erase cloned functions if we needed to update the kernel signature to
345346
// support preloading hidden kernel arguments.
346347
for (auto *F : FunctionsToErase)

0 commit comments

Comments
 (0)