File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
llvm/tools/sycl-post-link Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -689,9 +689,13 @@ int main(int argc, char **argv) {
689
689
return 1 ;
690
690
}
691
691
692
- // Special "llvm.used" variable which holds references to global values in the
693
- // module is known to cause problems for tools which run later in pipeline, so
694
- // remove it from the module before perfroming any other actions.
692
+ // After linking device bitcode "llvm.used" holds references to the kernels
693
+ // that are defined in the device image. But after splitting device image into
694
+ // separate kernels we may end up with having references to kernel declaration
695
+ // originating from "llvm.used" in the IR that is passed to llvm-spirv tool,
696
+ // and these declarations cause an assertion in llvm-spirv. To workaround this
697
+ // issue remove "llvm.used" from the input module before performing any other
698
+ // actions.
695
699
if (GlobalVariable *GV = MPtr->getGlobalVariable (" llvm.used" )) {
696
700
assert (GV->user_empty () && " unexpected llvm.used users" );
697
701
GV->eraseFromParent ();
You can’t perform that action at this time.
0 commit comments