Issue 171898
Summary [SPIRV] The result of `isShader` changes in the middle of compilation
Labels backend:SPIR-V
Assignees
Reporter s-perron
    In https://github.com/llvm/llvm-project/pull/129689, a new function `SPIRVSubtarget::isShader` was added. It is suppose to tell us of the module is a shader module so that the spir-v can be generated accordingly. The problem is that sometime, the compiler cannot know if the module is a shader by looking at the triple alone, so code was added to change the environment in the subtarget when lowering a function with the "hlsl.shader" attribute.

https://github.com/llvm/llvm-project/blob/854ef8df06b9a4b4b473d9b00a5f6f1fa73df210/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp#L256-L264


This means that if `isShader` is called before the entry point is processed, it will return false, and code that is not valid for a shader may be generated. This value needs to be set at the start of the compilation, and should not change.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to