Skip to content

Naga output for functions-optimized-by-version.wgsl crashes DXC #7651

@jimblandy

Description

@jimblandy

DXC built from moz-1.8.2502 crashes on the HLSL Naga generates for naga/tests/in/wgsl/functions-optimized-by-version.wgsl.

naga$ dxc tests/out/hlsl/wgsl-functions-optimized-by-version.hlsl -T cs_6_4 -E main -Wno-parentheses-equality -Zi -Qembed_debug -Od -HV 2018
otherwise, unexpected vector support in high level intrinsic templateError: assert()
File:
(0)
Func:	
Illegal instruction (core dumped)
naga$ 
Crash stack in DXC
#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=0x91f9c8, IOP=hlsl::IntrinsicOp::IOP_dot4add_u8packed, opcode=hlsl::DXIL::OpCode::Dot4AddU8Packed, helper=..., 
    pObjHelper=0x7fffffff8c80, Translated=@0x7fffffff8a6f: true) at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:5957
#3  0x00007ffff4e5b4d8 in TranslateBuiltinIntrinsic (CI=0x91f9c8, helper=..., pObjHelper=0x7fffffff8c80, Translated=@0x7fffffff8a6f: true)
    at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:6818
#4  0x00007ffff4e6761a in TranslateHLBuiltinOperation (F=0x8f1d98, helper=..., group=hlsl::HLOpcodeGroup::HLIntrinsic, pObjHelper=0x7fffffff8c80)
    at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:9010
#5  0x00007ffff4e68244 in hlsl::TranslateBuiltinOperations (HLM=..., extCodegenHelper=0x853a90, UpdateCounterSet=std::unordered_set with 0 elements)
    at /home/jimb/DirectXShaderCompiler/lib/HLSL/HLOperationLower.cpp:9192
#6  0x00007ffff4e21ba6 in (anonymous namespace)::DxilGenerationPass::GenerateDxilOperations (this=0x904cf0, 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=0x904cf0, M=...) at /home/jimb/DirectXShaderCompiler/lib/HLSL/DxilGenerationPass.cpp:251
#8  0x00007ffff692ace2 in (anonymous namespace)::MPPassManager::runOnModule (this=0x8f5b00, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1669
#9  0x00007ffff692b48d in llvm::legacy::PassManagerImpl::run (this=0x8f56c0, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1771
#10 0x00007ffff692b7fc in llvm::legacy::PassManager::run (this=0x8f5630, M=...) at /home/jimb/DirectXShaderCompiler/lib/IR/LegacyPassManager.cpp:1814
#11 0x00007ffff525d778 in (anonymous namespace)::EmitAssemblyHelper::EmitAssembly (this=0x7fffffff9800, Action=clang::Backend_EmitBC, OS=0x88ec40)
    at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/BackendUtil.cpp:760
#12 0x00007ffff525d95d in clang::EmitBackendOutput (Diags=..., CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x88f900, Action=clang::Backend_EmitBC, OS=0x88ec40)
    at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/BackendUtil.cpp:783
#13 0x00007ffff5239b91 in clang::BackendConsumer::HandleTranslationUnit (this=0x88edf0, 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=0x7fffffffa090) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/Frontend/FrontendAction.cpp:554
#16 0x00007ffff5237870 in clang::CodeGenAction::ExecuteAction (this=0x7fffffffa090) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/CodeGen/CodeGenAction.cpp:808
#17 0x00007ffff5570503 in clang::FrontendAction::Execute (this=0x7fffffffa090) at /home/jimb/DirectXShaderCompiler/tools/clang/lib/Frontend/FrontendAction.cpp:455
#18 0x00007ffff4a21bf4 in DxcCompiler::Compile (this=0x84d430, pSource=0x7fffffffc3d0, pArguments=0x84cf10, argCount=11, pIncludeHandler=0x84caf0, riid=..., ppResult=0x7fffffffc398)
    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"tests/out/hlsl/wgsl-functions-optimized-by-version.hlsl", pEntryPoint=0x84dcc0 L"main", pTargetProfile=0x84d9a0 L"cs_6_4", pArguments=0x84d3a0, argCount=10, 
    pDefines=0x7fffffffccd8, defineCount=0, pIncludeHandler=0x84caf0, ppResult=0x7fffffffc7e0, 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"tests/out/hlsl/wgsl-functions-optimized-by-version.hlsl", 
    pEntryPoint=0x84dcc0 L"main", pTargetProfile=0x84d9a0 L"cs_6_4", pArguments=0x84d3a0, argCount=10, pDefines=0x7fffffffccd8, defineCount=0, pIncludeHandler=0x84caf0, 
    ppResult=0x7fffffffc7e0, 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"tests/out/hlsl/wgsl-functions-optimized-by-version.hlsl", 
    pEntryPoint=0x84dcc0 L"main", pTargetProfile=0x84d9a0 L"cs_6_4", pArguments=0x84d3a0, argCount=10, pDefines=0x7fffffffccd8, defineCount=0, pIncludeHandler=0x84caf0, 
    ppResult=0x7fffffffc7e0) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxcompiler/dxcompileradapter.h:75
#22 0x000000000040805d in DxcContext::Compile (this=0x7fffffffd580) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxclib/dxc.cpp:874
#23 0x000000000040b321 in dxc::main (argc=12, argv_=0x7fffffffd768) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxclib/dxc.cpp:1502
#24 0x0000000000402406 in main (argc=12, argv_=0x7fffffffd768) at /home/jimb/DirectXShaderCompiler/tools/clang/tools/dxc/dxcmain.cpp:19

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: naga back-endOutputs of naga shader conversionexternal: driver-bugA driver is causing the bug, though we may still want to work around itlang: HLSLD3D Shading LanguagenagaShader Translator

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions