-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
Description
This is a known limitation I thought had been fixed by #169665
@s-perron is working on spirv matrix lowering and this issue will likely be fixed by his work to preserve the matrix type to use the SPIRV matrix type.
HLSL
RWBuffer<float> In : register(u0);
RWBuffer<int> MatOut : register(u1);
RWBuffer<int> ArrOut : register(u2);
RWBuffer<int> StructOut : register(u3);
struct S {
int A,B,C;
float X,Y,Z;
};
[numthreads(6,1,1)]
void main(uint GI : SV_GroupIndex) {
float2x3 A = float2x3(In[0], In[1], In[2],
In[3], In[4], In[5]);
float Arr[2][3] = {In[0], In[1], In[2],
In[3], In[4], In[5]};
S s = {(int)In[0], (int)In[1], (int)In[2],
In[3], In[4], In[5]};
const uint COLS = 3; // float2x3 => 2 rows, 3 columns
uint row = GI / COLS; // 0..1
uint col = GI % COLS; // 0..2
int2x3 B = (int2x3)A;
int2x3 C = (int2x3)Arr;
int2x3 D = (int2x3)s;
MatOut[GI] = B[row][col];
ArrOut[GI] = C[row][col];
StructOut[GI] = D[row][col];
}Crash stack
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\clang-dxc.exe' -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_cast.test.tmp.o' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_cast.test.tmp/source.hlsl'
# .---command stderr------------
# | fatal error: error in backend: unable to legalize instruction: %68:vid(<6 x s32>) = G_BUILD_VECTOR %173:_(s32), %174:_(s32), %175:_(s32), %176:_(s32), %170:_(s32), %171:_(s32) (in function: main)
# | 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: e:\\actions-runner\\_work\\offload-test-suite\\offload-test-suite\\llvm-project\\build\\bin\\clang-dxc.exe -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo E:\\actions-runner\\_work\\offload-test-suite\\offload-test-suite\\llvm-project\\build\\tools\\OffloadTest\\test\\clang-vk\\Basic\\Matrix\\Output\\matrix_elementwise_cast.test.tmp.o E:\\actions-runner\\_work\\offload-test-suite\\offload-test-suite\\llvm-project\\build\\tools\\OffloadTest\\test\\clang-vk\\Basic\\Matrix\\Output\\matrix_elementwise_cast.test.tmp/source.hlsl
# | 1. <eof> parser at end of file
# | 2. Code generation
# | 3. Running pass 'Function Pass Manager' on module 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_cast.test.tmp/source.hlsl'.
# | 4. Running pass 'Legalizer' on function '@main'
# | Exception Code: 0xE0000001
# | #0 0x00007ff9e548804a (C:\WINDOWS\System32\KERNELBASE.dll+0xc804a)
# | #1 0x00007ff6e43822aa llvm::CrashRecoveryContext::HandleExit(int) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\Support\CrashRecoveryContext.cpp:446:0
# | #2 0x00007ff6e4382f09 llvm::sys::Process::Exit(int, bool) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\Support\Process.cpp:117:0
# | #3 0x00007ff6e3e78f31 LLVMErrorHandler E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\cc1_main.cpp:81:0
# | #4 0x00007ff6e43d1672 std::_String_val<std::_Simple_types<char> >::_Large_mode_engaged C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:453:0
# | #5 0x00007ff6e43d1672 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:3083:0
# | #6 0x00007ff6e43d1672 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:1383:0
# | #7 0x00007ff6e43d1672 llvm::report_fatal_error(class llvm::Twine const &, bool) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\Support\ErrorHandling.cpp:117:0
# | #8 0x00007ff6e43d187b llvm::reportFatalUsageError(class llvm::Twine const &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\Support\ErrorHandling.cpp:156:0
# | #9 0x00007ff6e5d3df50 std::_Adjust_manually_vector_aligned C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xmemory:219:0
# | #10 0x00007ff6e5d3df50 std::_Deallocate C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xmemory:286:0
# | #11 0x00007ff6e5d3df50 std::allocator<char>::deallocate C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xmemory:985:0
# | #12 0x00007ff6e5d3df50 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Deallocate_for_capacity C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:852:0
# | #13 0x00007ff6e5d3df50 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:3086:0
# | #14 0x00007ff6e5d3df50 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring:1383:0
# | #15 0x00007ff6e5d3df50 reportGISelDiagnostic E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\CodeGen\GlobalISel\Utils.cpp:245:0
# | #16 0x00007ff6e5d3e281 llvm::DiagnosticInfoOptimizationBase::~DiagnosticInfoOptimizationBase E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\IR\DiagnosticInfo.h:521:0
# | #17 0x00007ff6e5d3e281 llvm::reportGISelFailure(class llvm::MachineFunction &, class llvm::MachineOptimizationRemarkEmitter &, char const *, class llvm::StringRef, class llvm::MachineInstr const &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\CodeGen\GlobalISel\Utils.cpp:278:0
# | #18 0x00007ff6e47d374b llvm::Legalizer::runOnMachineFunction(class llvm::MachineFunction &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\CodeGen\GlobalISel\Legalizer.cpp:351:0
# | #19 0x00007ff6e4704305 llvm::MachineFunctionPass::runOnFunction(class llvm::Function &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\CodeGen\MachineFunctionPass.cpp:108:0
# | #20 0x00007ff6e4107702 llvm::FPPassManager::runOnFunction(class llvm::Function &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1398:0
# | #21 0x00007ff6e410ecbd llvm::FPPassManager::runOnModule(class llvm::Module &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1444:0
# | #22 0x00007ff6e4107f7f `anonymous namespace'::MPPassManager::runOnModule E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1513:0
# | #23 0x00007ff6e4107b8e llvm::legacy::PassManagerImpl::run(class llvm::Module &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:531:0
# | #24 0x00007ff6e549d094 `anonymous namespace'::EmitAssemblyHelper::RunCodegenPipeline E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1304:0
# | #25 0x00007ff6e5493fa8 std::unique_ptr<llvm::ToolOutputFile,std::default_delete<llvm::ToolOutputFile> >::operator bool C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\memory:3461:0
# | #26 0x00007ff6e5493fa8 `anonymous namespace'::EmitAssemblyHelper::emitAssembly E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1329:0
# | #27 0x00007ff6e5492cc2 std::unique_ptr<llvm::TargetMachine,std::default_delete<llvm::TargetMachine> >::operator bool C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\memory:3461:0
# | #28 0x00007ff6e5492cc2 clang::emitBackendOutput(class clang::CompilerInstance &, class clang::CodeGenOptions &, class llvm::StringRef, class llvm::Module *, enum clang::BackendAction, class llvm::IntrusiveRefCntPtr<class llvm::vfs::FileSystem>, class std::unique_ptr<class llvm::raw_pwrite_stream, struct std::default_delete<class llvm::raw_pwrite_stream>>, class clang::BackendConsumer *) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1501:0
# | #29 0x00007ff6e5a7f3fe clang::BackendConsumer::HandleTranslationUnit(class clang::ASTContext &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\CodeGen\CodeGenAction.cpp:312:0
# | #30 0x00007ff6e7b7a857 clang::ParseAST(class clang::Sema &, bool, bool) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Parse\ParseAST.cpp:183:0
# | #31 0x00007ff6e5a2bd06 clang::HLSLFrontendAction::ExecuteAction(void) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Frontend\FrontendActions.cpp:1323:0
# | #32 0x00007ff6e59c08c1 clang::FrontendAction::Execute(void) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Frontend\FrontendAction.cpp:1316:0
# | #33 0x00007ff6e44e5bab llvm::Error::getPtr E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\Support\Error.h:277:0
# | #34 0x00007ff6e44e5bab llvm::Error::operator bool E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\Support\Error.h:241:0
# | #35 0x00007ff6e44e5bab clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Frontend\CompilerInstance.cpp:1003:0
# | #36 0x00007ff6e459b769 clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\FrontendTool\ExecuteCompilerInvocation.cpp:310:0
# | #37 0x00007ff6e3e776b6 cc1_main(class llvm::ArrayRef<char const *>, char const *, void *) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\cc1_main.cpp:301:0
# | #38 0x00007ff6e3e732e0 ExecuteCC1Tool E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\driver.cpp:225:0
# | #39 0x00007ff6e3e76dd8 clang_main::<lambda_0>::operator() E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\driver.cpp:369:0
# | #40 0x00007ff6e3e76dd8 llvm::function_ref<int (llvm::SmallVectorImpl<const char *> &)>::callback_fn<`lambda at E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\driver.cpp:367:32'> E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:46:0
# | #41 0x00007ff6e579674d clang::driver::CC1Command::Execute::<lambda_1>::operator() E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Job.cpp:437:0
# | #42 0x00007ff6e579674d llvm::function_ref<void ()>::callback_fn<`lambda at E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Job.cpp:437:22'> E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:46:0
# | #43 0x00007ff6e4382155 llvm::CrashRecoveryContext::RunSafely(class llvm::function_ref<(void)>) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\lib\Support\CrashRecoveryContext.cpp:235:0
# | #44 0x00007ff6e5795a3b clang::driver::CC1Command::Execute(class llvm::ArrayRef<class std::optional<class llvm::StringRef>>, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> *, bool *) const E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Job.cpp:437:0
# | #45 0x00007ff6e44ca3c2 clang::driver::Compilation::ExecuteCommand(class clang::driver::Command const &, class clang::driver::Command const *&, bool) const E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Compilation.cpp:196:0
# | #46 0x00007ff6e44ca64d clang::driver::Compilation::ExecuteJobs(class clang::driver::JobList const &, class llvm::SmallVectorImpl<struct std::pair<int, class clang::driver::Command const *>> &, bool) const E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Compilation.cpp:246:0
# | #47 0x00007ff6e44a0a7c llvm::SmallVectorBase<unsigned int>::empty E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\llvm\include\llvm\ADT\SmallVector.h:83:0
# | #48 0x00007ff6e44a0a7c clang::driver::Driver::ExecuteCompilation(class clang::driver::Compilation &, class llvm::SmallVectorImpl<struct std::pair<int, class clang::driver::Command const *>> &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\lib\Driver\Driver.cpp:2263:0
# | #49 0x00007ff6e3e726ba clang_main(int, char **, struct llvm::ToolContext const &) E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\clang\tools\driver\driver.cpp:407:0
# | #50 0x00007ff6e3e87e27 main E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\clang\tools\driver\clang-driver.cpp:17:0
# | #51 0x00007ff6ea0c6c74 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
# | #52 0x00007ff6ea0c6c74 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
# | #53 0x00007ff9e6c8e8d7 (C:\WINDOWS\System32\KERNEL32.DLL+0x2e8d7)
# | #54 0x00007ff9e7c6c53c (C:\WINDOWS\SYSTEM32\ntdll.dll+0x8c53c)
# `-----------------------------
# error: command failed with exit status: 1
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Planning