================ @@ -79,7 +79,7 @@ let TargetPrefix = "spv" in { def int_spv_refract : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty, LLVMMatchType<0>, - LLVMVectorElementType<0>], + llvm_anyfloat_ty], ---------------- raoanag wrote:
yes, it was causing a crash while SPIRV tries to generate scalar agrs ``` # .---command stderr------------ # | Assertion failed: Res == Intrinsic::MatchIntrinsicTypes_Match && TableRef.empty() && "Wrong types for intrinsic!", file C:/Users/anagrao/llvm-project/llvm/lib/IR/IRBuilder.cpp, line 876 # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. # | Stack dump: # | 0. Program arguments: c:\\users\\anagrao\\llvm-build\\bin\\clang.exe -cc1 -internal-isystem C:\\Users\\anagrao\\llvm-build\\lib\\clang\\21\\include -nostdsysteminc -finclude-default-header -triple spirv-unknown-vulkan-compute C:\\Users\\anagrao\\llvm-project\\clang\\test\\CodeGenHLSL\\builtins\\refract.hlsl -fnative-half-type -emit-llvm -o - # | 1. <eof> parser at end of file # | 2. Per-file LLVM IR generation # | 3. C:\Users\anagrao\llvm-build\lib\clang\21\include\hlsl/hlsl_intrinsic_helpers.h:74:47: Generating code for declaration 'hlsl::__detail::refract_impl' # | Exception Code: 0xC000001D # | #0 0x00007ff7bd3a7bc6 HandleAbort C:\Users\anagrao\llvm-project\llvm\lib\Support\Windows\Signals.inc:372:0 # | #1 0x00007ffd5ea71989 (C:\Windows\System32\ucrtbase.dll+0xc1989) # | #2 0x00007ffd5ea54ab1 (C:\Windows\System32\ucrtbase.dll+0xa4ab1) # | #3 0x00007ffd5ea72986 (C:\Windows\System32\ucrtbase.dll+0xc2986) # | #4 0x00007ffd5ea72b61 (C:\Windows\System32\ucrtbase.dll+0xc2b61) # | #5 0x00007ff7bdebc0c5 llvm::SmallVectorTemplateCommon<llvm::Type *,void>::begin C:\Users\anagrao\llvm-project\llvm\include\llvm\ADT\SmallVector.h:269:0 # | #6 0x00007ff7bdebc0c5 llvm::SmallVectorTemplateCommon<llvm::Type *,void>::data C:\Users\anagrao\llvm-project\llvm\include\llvm\ADT\SmallVector.h:289:0 # | #7 0x00007ff7bdebc0c5 llvm::ArrayRef<llvm::Type *>::ArrayRef C:\Users\anagrao\llvm-project\llvm\include\llvm\ADT\ArrayRef.h:100:0 # | #8 0x00007ff7bdebc0c5 llvm::IRBuilderBase::CreateIntrinsic(class llvm::Type *, unsigned int, class llvm::ArrayRef<class llvm::Value *>, class llvm::FMFSource, class llvm::Twine const &) C:\Users\anagrao\llvm-project\llvm\lib\IR\IRBuilder.cpp:879:0 # | #9 0x00007ff7c264e5ab clang::CodeGen::CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned int, class clang::CallExpr const *) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\TargetBuiltins\SPIR.cpp:34:0 # | #10 0x00007ff7c13c5651 clang::CodeGen::CodeGenFunction::EmitTargetBuiltinExpr(unsigned int, class clang::CallExpr const *, class clang::CodeGen::ReturnValueSlot) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGBuiltin.cpp:142:0 # | #11 0x00007ff7c13dfba5 clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(class clang::GlobalDecl, unsigned int, class clang::CallExpr const *, class clang::CodeGen::ReturnValueSlot) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGBuiltin.cpp:6437:0 # | #12 0x00007ff7bf9a45b8 clang::CodeGen::CodeGenFunction::EmitCallExpr(class clang::CallExpr const *, class clang::CodeGen::ReturnValueSlot, class llvm::CallBase **) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGExpr.cpp:5856:0 # | #13 0x00007ff7c117f016 clang::CodeGen::RValue::isScalar C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGValue.h:64:0 # | #14 0x00007ff7c117f016 clang::CodeGen::RValue::getScalarVal C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGValue.h:72:0 # | #15 0x00007ff7c117f016 `anonymous namespace'::ScalarExprEmitter::VisitCallExpr C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGExprScalar.cpp:629:0 # | #16 0x00007ff7c1168213 `anonymous namespace'::ScalarExprEmitter::ScalarExprEmitter C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGExprScalar.cpp:450:0 # | #17 0x00007ff7c1168213 clang::CodeGen::CodeGenFunction::EmitScalarExpr(class clang::Expr const *, bool) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGExprScalar.cpp:5831:0 # | #18 0x00007ff7bfcb0655 clang::CodeGen::CodeGenFunction::EmitReturnStmt(class clang::ReturnStmt const &) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGStmt.cpp:1688:0 # | #19 0x00007ff7bfcac558 clang::CodeGen::CodeGenFunction::EmitStmt(class clang::Stmt const *, class llvm::ArrayRef<class clang::Attr const *>) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGStmt.cpp:163:0 # | #20 0x00007ff7bfcbb435 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(class clang::CompoundStmt const &, bool, class clang::CodeGen::AggValueSlot) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CGStmt.cpp:588:0 # | #21 0x00007ff7bf92c789 clang::CodeGen::CodeGenFunction::EmitFunctionBody(class clang::Stmt const *) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenFunction.cpp:1371:0 # | #22 0x00007ff7bf92dbc0 clang::CodeGen::CodeGenFunction::getLangOpts C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenFunction.h:2157:0 # | #23 0x00007ff7bf92dbc0 clang::CodeGen::CodeGenFunction::GenerateCode(class clang::GlobalDecl, class llvm::Function *, class clang::CodeGen::CGFunctionInfo const &) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenFunction.cpp:1633:0 # | #24 0x00007ff7be3af29b clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(class clang::GlobalDecl, class llvm::GlobalValue *) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenModule.cpp:6308:0 # | #25 0x00007ff7be3a5b5f llvm::TimeTraceScope::~TimeTraceScope C:\Users\anagrao\llvm-project\llvm\include\llvm\Support\TimeProfiler.h:200:0 # | #26 0x00007ff7be3a5b5f clang::CodeGen::CodeGenModule::EmitGlobalDefinition(class clang::GlobalDecl, class llvm::GlobalValue *) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenModule.cpp:4413:0 # | #27 0x00007ff7be391285 std::vector<const clang::CXXRecordDecl *,std::allocator<const clang::CXXRecordDecl *> >::empty C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\vector:1910:0 # | #28 0x00007ff7be391285 clang::CodeGen::CodeGenModule::EmitDeferred(void) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenModule.cpp:3493:0 # | #29 0x00007ff7be3912b1 std::vector<const clang::CXXRecordDecl *,std::allocator<const clang::CXXRecordDecl *> >::empty C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\vector:1910:0 # | #30 0x00007ff7be3912b1 clang::CodeGen::CodeGenModule::EmitDeferred(void) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenModule.cpp:3495:0 # | #31 0x00007ff7be38da63 clang::CodeGen::CodeGenModule::Release(void) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenModule.cpp:960:0 # | #32 0x00007ff7c0c6ab0d `anonymous namespace'::CodeGeneratorImpl::HandleTranslationUnit C:\Users\anagrao\llvm-project\clang\lib\CodeGen\ModuleBuilder.cpp:291:0 # | #33 0x00007ff7bea7486a clang::BackendConsumer::HandleTranslationUnit(class clang::ASTContext &) C:\Users\anagrao\llvm-project\clang\lib\CodeGen\CodeGenAction.cpp:243:0 # | #34 0x00007ff7c0aafcb7 clang::ParseAST(class clang::Sema &, bool, bool) C:\Users\anagrao\llvm-project\clang\lib\Parse\ParseAST.cpp:183:0 # | #35 0x00007ff7be9a2111 clang::FrontendAction::Execute(void) C:\Users\anagrao\llvm-project\clang\lib\Frontend\FrontendAction.cpp:1225:0 # | #36 0x00007ff7bd50558b llvm::Error::getPtr C:\Users\anagrao\llvm-project\llvm\include\llvm\Support\Error.h:277:0 # | #37 0x00007ff7bd50558b llvm::Error::operator bool C:\Users\anagrao\llvm-project\llvm\include\llvm\Support\Error.h:241:0 # | #38 0x00007ff7bd50558b clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) C:\Users\anagrao\llvm-project\clang\lib\Frontend\CompilerInstance.cpp:1055:0 # | #39 0x00007ff7bd5b872d clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) C:\Users\anagrao\llvm-project\clang\lib\FrontendTool\ExecuteCompilerInvocation.cpp:299:0 # | #40 0x00007ff7bcea7672 cc1_main(class llvm::ArrayRef<char const *>, char const *, void *) C:\Users\anagrao\llvm-project\clang\tools\driver\cc1_main.cpp:297:0 # | #41 0x00007ff7bcea32b1 ExecuteCC1Tool C:\Users\anagrao\llvm-project\clang\tools\driver\driver.cpp:223:0 # | #42 0x00007ff7bcea2412 clang_main(int, char **, struct llvm::ToolContext const &) C:\Users\anagrao\llvm-project\clang\tools\driver\driver.cpp:264:0 # | #43 0x00007ff7bceb7c27 main C:\Users\anagrao\llvm-build\tools\clang\tools\driver\clang-driver.cpp:17:0 # | #44 0x00007ff7c2fb8464 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0 # | #45 0x00007ff7c2fb8464 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0 # | #46 0x00007ffd5ed4e8d7 (C:\Windows\System32\KERNEL32.DLL+0x2e8d7) # | #47 0x00007ffd60e5c34c (C:\Windows\SYSTEM32\ntdll.dll+0x3c34c) # `----------------------------- ``` https://github.com/llvm/llvm-project/pull/147342 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits