|
34 | 34 | #include "llvm/IR/IntrinsicsSPIRV.h"
|
35 | 35 | #include "llvm/Support/Debug.h"
|
36 | 36 | #include "llvm/Support/ErrorHandling.h"
|
| 37 | +#include "llvm/Support/raw_ostream.h" |
37 | 38 |
|
38 | 39 | #define DEBUG_TYPE "spirv-isel"
|
39 | 40 |
|
@@ -3031,9 +3032,14 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
|
3031 | 3032 | case Intrinsic::spv_normalize:
|
3032 | 3033 | return selectExtInst(ResVReg, ResType, I, CL::normalize, GL::Normalize);
|
3033 | 3034 | case Intrinsic::spv_reflect:
|
3034 |
| - if (STI.isVulkanEnv()) // There is no CL equivalent of Reflect |
3035 |
| - return selectExtInst(ResVReg, ResType, I, GL::Reflect); |
3036 |
| - break; |
| 3035 | + if (!STI.canUseExtInstSet(SPIRV::InstructionSet::InstructionSet::GLSL_std_450)) { |
| 3036 | + std::string DiagMsg; |
| 3037 | + raw_string_ostream OS(DiagMsg); |
| 3038 | + I.print(OS); |
| 3039 | + DiagMsg = "Intrinsic selection not supported for this instruction set: " + DiagMsg; |
| 3040 | + report_fatal_error(DiagMsg.c_str(), false); |
| 3041 | + } |
| 3042 | + return selectExtInst(ResVReg, ResType, I, GL::Reflect); |
3037 | 3043 | case Intrinsic::spv_rsqrt:
|
3038 | 3044 | return selectExtInst(ResVReg, ResType, I, CL::rsqrt, GL::InverseSqrt);
|
3039 | 3045 | case Intrinsic::spv_sign:
|
|
0 commit comments