[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)
Deric Cheung via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 09:51:24 PST 2025
================
@@ -0,0 +1,33 @@
+; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
----------------
Icohedron wrote:
Changing the triple to `-mtriple=spirv32-unknown-unknown` does indeed cause the test to fail at instruction selection
```
********************
FAIL: LLVM :: CodeGen/SPIRV/hlsl-intrinsics/reflect.ll (282 of 582)
******************** TEST 'LLVM :: CodeGen/SPIRV/hlsl-intrinsics/reflect.ll' FAILED ********************
Exit Code: 2
Command Output (stderr):
--
RUN: at line 1: /workspace/feature-reflect/build/bin/llc -O0 -mtriple=spirv32-unknown-unknown /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll -o - | /workspace/feature-reflect/build/bin/FileCheck /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll
+ /workspace/feature-reflect/build/bin/FileCheck /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll
+ /workspace/feature-reflect/build/bin/llc -O0 -mtriple=spirv32-unknown-unknown /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll -o -
LLVM ERROR: cannot select: %6:id(<2 x s64>) = G_INTRINSIC intrinsic(@llvm.spv.reflect), %0:vfid(<2 x s64>), %1:vfid(<2 x s64>) (in function: reflect_half4)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /workspace/feature-reflect/build/bin/llc -O0 -mtriple=spirv32-unknown-unknown /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll -o -
1. Running pass 'Function Pass Manager' on module '/workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll'.
2. Running pass 'InstructionSelect' on function '@reflect_half4'
#0 0x00005a7a8f13318f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /workspace/feature-reflect/llvm/lib/Support/Unix/Signals.inc:804:3
#1 0x00005a7a8f130a5f llvm::sys::RunSignalHandlers() /workspace/feature-reflect/llvm/lib/Support/Signals.cpp:105:20
#2 0x00005a7a8f130db6 SignalHandler(int) /workspace/feature-reflect/llvm/lib/Support/Unix/Signals.inc:417:1
#3 0x000071ee82242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000071ee822969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000071ee82242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000071ee822287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00005a7a8f08b463 (/workspace/feature-reflect/build/bin/llc+0x3631463)
#8 0x00005a7a8f664b32 reportGISelDiagnostic(llvm::DiagnosticSeverity, llvm::MachineFunction&, llvm::TargetPassConfig const&, llvm::MachineOptimizationRemarkEmitter&, llvm::MachineOptimizationRemarkMissed&) /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/Utils.cpp:248:23
#9 0x00005a7a8f666a55 llvm::DiagnosticInfoOptimizationBase::~DiagnosticInfoOptimizationBase() /workspace/feature-reflect/llvm/include/llvm/IR/DiagnosticInfo.h:486:7
#10 0x00005a7a8f666a55 llvm::DiagnosticInfoMIROptimization::~DiagnosticInfoMIROptimization() /workspace/feature-reflect/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:31:7
#11 0x00005a7a8f666a55 llvm::MachineOptimizationRemarkMissed::~MachineOptimizationRemarkMissed() /workspace/feature-reflect/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:85:7
#12 0x00005a7a8f666a55 llvm::reportGISelFailure(llvm::MachineFunction&, llvm::TargetPassConfig const&, llvm::MachineOptimizationRemarkEmitter&, char const*, llvm::StringRef, llvm::MachineInstr const&) /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/Utils.cpp:277:1
#13 0x00005a7a8f5ce077 llvm::SmallVectorTemplateCommon<std::tuple<llvm::MachineBasicBlock*, llvm::MachineBasicBlock**, llvm::MachineBasicBlock**>, void>::begin() /workspace/feature-reflect/llvm/include/llvm/ADT/SmallVector.h:267:45
#14 0x00005a7a8f5ce077 llvm::SmallVectorTemplateCommon<std::tuple<llvm::MachineBasicBlock*, llvm::MachineBasicBlock**, llvm::MachineBasicBlock**>, void>::end() /workspace/feature-reflect/llvm/include/llvm/ADT/SmallVector.h:269:32
#15 0x00005a7a8f5ce077 llvm::SmallVector<std::tuple<llvm::MachineBasicBlock*, llvm::MachineBasicBlock**, llvm::MachineBasicBlock**>, 8u>::~SmallVector() /workspace/feature-reflect/llvm/include/llvm/ADT/SmallVector.h:1202:24
#16 0x00005a7a8f5ce077 llvm::po_iterator<llvm::MachineFunction*, llvm::SmallPtrSet<llvm::MachineBasicBlock*, 8u>, false, llvm::GraphTraits<llvm::MachineFunction*>>::~po_iterator() /workspace/feature-reflect/llvm/include/llvm/ADT/PostOrderIterator.h:97:7
#17 0x00005a7a8f5ce077 llvm::InstructionSelect::selectMachineFunction(llvm::MachineFunction&) /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:225:5
#18 0x00005a7a8f5cf70c operator() /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:145:59
#19 0x00005a7a8f5cf70c ~scope_exit /workspace/feature-reflect/llvm/include/llvm/ADT/ScopeExit.h:46:19
#20 0x00005a7a8f5cf70c llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:157:1
#21 0x00005a7a8f5cf70c llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) /workspace/feature-reflect/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:134:6
#22 0x00005a7a8dfbf72a llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) /workspace/feature-reflect/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:33
#23 0x00005a7a8e576eca llvm::FPPassManager::runOnFunction(llvm::Function&) /workspace/feature-reflect/llvm/lib/IR/LegacyPassManager.cpp:1416:7
#24 0x00005a7a8e577119 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /workspace/feature-reflect/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#25 0x00005a7a8e577119 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /workspace/feature-reflect/llvm/include/llvm/ADT/ilist_node.h:117:66
#26 0x00005a7a8e577119 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /workspace/feature-reflect/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#27 0x00005a7a8e577119 llvm::FPPassManager::runOnModule(llvm::Module&) /workspace/feature-reflect/llvm/lib/IR/LegacyPassManager.cpp:1451:22
#28 0x00005a7a8e5779c0 runOnModule /workspace/feature-reflect/llvm/lib/IR/LegacyPassManager.cpp:1528:7
#29 0x00005a7a8e5779c0 llvm::legacy::PassManagerImpl::run(llvm::Module&) /workspace/feature-reflect/llvm/lib/IR/LegacyPassManager.cpp:539:55
#30 0x00005a7a8d4f741f compileModule(char**, llvm::LLVMContext&) /workspace/feature-reflect/llvm/tools/llc/llc.cpp:753:34
#31 0x00005a7a8d4f7de6 main /workspace/feature-reflect/llvm/tools/llc/llc.cpp:411:35
#32 0x000071ee82229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x000071ee82229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x00005a7a8d4e9e65 _start (/workspace/feature-reflect/build/bin/llc+0x1a8fe65)
FileCheck error: '<stdin>' is empty.
FileCheck command line: /workspace/feature-reflect/build/bin/FileCheck /workspace/feature-reflect/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll
```
https://github.com/llvm/llvm-project/pull/122992
More information about the llvm-commits
mailing list