Repository navigation
Closed
Labels
Description
Using DXC built as described in #7395, and invoked as:
dxc -Od -T cs_6_8 reduced.hlsl
the following causes a crash:
[numthreads(1, 1, 1)]
void main()
{
uint c_6_ = dot4add_u8packed(0, 0, 0);
dot4add_u8packed(0, 0, c_6_);
}Call stack
#0 (anonymous namespace)::llvm_assert_trap (_Message=0x7ffff6f2fb30 "", _File=0x7ffff6f2fb30 "", _Line=0, _Function=0x7ffff6f2fb30 "")
at /home/jimb/DirectXShaderCompiler/lib/Support/assert.cpp:18
#1 0x00007ffff518876f in llvm_assert (Message=0x7ffff6f2fb30 "", File=0x7ffff6f2fb30 "", Line=0, Function=0x7ffff6f2fb30 "") at /home/jimb/DirectXShaderCompiler/lib/Support/assert.cpp:41
#2 0x00007ffff4e5a110 in (anonymous namespace)::TranslateDot4AddPacked (CI=0x8ec1b8, IOP=hlsl::IntrinsicOp::IOP_dot4add_u8packed, opcode=hlsl::DXIL::OpCode::Dot4AddU8Packed, helper=...,
pObjHelper=0x7fffffff8c90, Translated=@0x7fffffff8a7f: true) at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:5957
#3 0x00007ffff4e5b4d8 in TranslateBuiltinIntrinsic (CI=0x8ec1b8, helper=..., pObjHelper=0x7fffffff8c90, Translated=@0x7fffffff8a7f: true)
at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:6818
#4 0x00007ffff4e6761a in TranslateHLBuiltinOperation (F=0x8ec018, helper=..., group=hlsl::HLOpcodeGroup::HLIntrinsic, pObjHelper=0x7fffffff8c90)
at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:9010
#5 0x00007ffff4e68244 in hlsl::TranslateBuiltinOperations (HLM=..., extCodegenHelper=0x8535f0, UpdateCounterSet=std::unordered_set with 0 elements)
at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:9192
#6 0x00007ffff4e21ba6 in (anonymous namespace)::DxilGenerationPass::GenerateDxilOperations (this=0x8fe630, M=..., UpdateCounterSet=std::unordered_set with 0 elements)
at /home/jimb/DirectXShaderCompiler/lib/HLSL/DxilGenerationPass.cpp:827
#7 0x00007ffff4e1efce in (anonymous namespace)::DxilGenerationPass::runOnModule (this=0x8fe630, M=...) at /home/jimb/DirectXShaderCompiler/lib/HLSL/DxilGenerationPass.cpp:251
#8 0x00007ffff692ace2 in (anonymous namespace)::MPPassManager::runOnModule (this=0x882de0, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1669
#9 0x00007ffff692b48d in llvm::legacy::PassManagerImpl::run (this=0x8ef200, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1771
#10 0x00007ffff692b7fc in llvm::legacy::PassManager::run (this=0x8ef170, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1814
#11 0x00007ffff525d778 in (anonymous namespace)::EmitAssemblyHelper::EmitAssembly (this=0x7fffffff9810, Action=clang::Backend_EmitBC, OS=0x88e6a0)
at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/BackendUtil.cpp:760
#12 0x00007ffff525d95d in clang::EmitBackendOutput (Diags=..., CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x88f360, Action=clang::Backend_EmitBC, OS=0x88e6a0)
at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/BackendUtil.cpp:783
#13 0x00007ffff5239b91 in clang::BackendConsumer::HandleTranslationUnit (this=0x88e850, C=...) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/CodeGenAction.cpp:192
#14 0x00007ffff64f4def in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/Parse/ParseAST.cpp:164
#15 0x00007ffff5570a0b in clang::ASTFrontendAction::ExecuteAction (this=0x7fffffffa0a0) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/Frontend/FrontendAction.cpp:554
#16 0x00007ffff5237870 in clang::CodeGenAction::ExecuteAction (this=0x7fffffffa0a0) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/CodeGenAction.cpp:808
#17 0x00007ffff5570503 in clang::FrontendAction::Execute (this=0x7fffffffa0a0) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/Frontend/FrontendAction.cpp:455
#18 0x00007ffff4a21bf4 in DxcCompiler::Compile (this=0x84d430, pSource=0x7fffffffc3e0, pArguments=0x84cf10, argCount=11, pIncludeHandler=0x84caf0, riid=..., ppResult=0x7fffffffc3a8)
at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxcompiler/dxcompilerobj.cpp:974
#19 0x00007ffff4a14b87 in hlsl::DxcCompilerAdapter::WrapCompile (this=0x84d850, bPreprocess=false, pSource=0x84d870, pSourceName=0x84d8b0 L"/home/jimb/naga-crashes-dxc-2/reduced.hlsl",
pEntryPoint=0x84db00 L"main", pTargetProfile=0x84d970 L"cs_6_4", pArguments=0x84d3a0, argCount=10, pDefines=0x7fffffffcce8, defineCount=0, pIncludeHandler=0x84caf0,
ppResult=0x7fffffffc7f0, ppDebugBlobName=0x0, ppDebugBlob=0x0) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxcompiler/dxcompilerobj.cpp:1851
#20 0x00007ffff4a1437c in hlsl::DxcCompilerAdapter::CompileWithDebug (this=0x84d850, pSource=0x84d870, pSourceName=0x84d8b0 L"/home/jimb/naga-crashes-dxc-2/reduced.hlsl",
pEntryPoint=0x84db00 L"main", pTargetProfile=0x84d970 L"cs_6_4", pArguments=0x84d3a0, argCount=10, pDefines=0x7fffffffcce8, defineCount=0, pIncludeHandler=0x84caf0,
ppResult=0x7fffffffc7f0, ppDebugBlobName=0x0, ppDebugBlob=0x0) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxcompiler/dxcompilerobj.cpp:1754
#21 0x00007ffff4a1bde7 in hlsl::DxcCompilerAdapter::Compile (this=0x84d850, pSource=0x84d870, pSourceName=0x84d8b0 L"/home/jimb/naga-crashes-dxc-2/reduced.hlsl",
pEntryPoint=0x84db00 L"main", pTargetProfile=0x84d970 L"cs_6_4", pArguments=0x84d3a0, argCount=10, pDefines=0x7fffffffcce8, defineCount=0, pIncludeHandler=0x84caf0,
ppResult=0x7fffffffc7f0) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxcompiler/dxcompileradapter.h:75
#22 0x000000000040805d in DxcContext::Compile (this=0x7fffffffd590) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxclib/dxc.cpp:874
#23 0x000000000040b321 in dxc::main (argc=12, argv_=0x7fffffffd778) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxclib/dxc.cpp:1502
#24 0x0000000000402406 in main (argc=12, argv_=0x7fffffffd778) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxc/dxcmain.cpp:19
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriaged
Activity
jimblandy commentedon Apr 30, 2025
I have no idea if I'm barking up the right tree, but when processing the first call to
dot4add_u8unpacked,AddOverloadedCallCandidates's call toHLSLExternalSource::MatchArgumentsleavesfunctionArgTypesset to[literal int, unsigned int, unsigned int, literal int], and we end up with a callee:It seems to me that
i64is wrong as the return type and third argument type, especially since the failing assertion is this one:jimblandy commentedon Apr 30, 2025
This is the code in
MatchArgumentsthat sets the other arguments tounsigned int. It skips the third argument, since that's the one that determines the return type.Fix the return types of `dot4add_i8packed` and `dot4add_u8packed`.
Fix the return types of `dot4add_i8packed` and `dot4add_u8packed`.
Fix the return types of `dot4add_i8packed` and `dot4add_u8packed`.
Fix return types of dot4add_i8packed, dot4add_u8packed, and dot2add.
Fix return types of dot4add_i8packed, dot4add_u8packed, and dot2add.
Fix the return types of `dot4add_i8packed` and `dot4add_u8packed`. (m…