intel / intel-graphics-compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion failure

maleadt opened this issue · comments

While reducing #318 I ran into another assertion failure that seems to stem from otherwise benign code:

target triple = "spir64-unknown-unknown"

declare float @f(float)

define spir_kernel void @kernel(float addrspace(1)* %0) {
entry:
  br label %loop

loop:
  %v8 = load float, float addrspace(1)* %0, align 4
  %v9 = call float @f(float %v8)
  br label %loop
}

Translated using llvm-spirv:

119734787 65536 393230 19 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
5 ExtInstImport 1 "OpenCL.std"
3 MemoryModel 2 2
5 EntryPoint 6 15 "kernel"
3 ExecutionMode 15 31
3 Source 0 0
3 Name 4 "f"
4 Name 9 "kernel"
4 Name 11 "entry"
4 Name 12 "loop"
3 Name 13 "v8"
3 Name 14 "v9"
5 Decorate 4 LinkageAttributes "f" Import
6 Decorate 9 LinkageAttributes "kernel" Export
3 TypeFloat 2 32
4 TypeFunction 3 2 2
2 TypeVoid 6
4 TypePointer 7 5 2
4 TypeFunction 8 6 7


5 Function 2 4 0 3
3 FunctionParameter 2 5

1 FunctionEnd

5 Function 6 9 0 8
3 FunctionParameter 7 10

2 Label 11
2 Branch 12

2 Label 12
6 Load 2 13 10 2 4
5 FunctionCall 2 14 4 13
2 Branch 12

1 FunctionEnd

5 Function 6 15 0 8
3 FunctionParameter 7 16

2 Label 17
5 FunctionCall 6 18 9 16
1 Return

1 FunctionEnd

Loaded using zeModuleCreate:

/workspace/srcdir/intel-graphics-compiler/visa/iga/IGALibrary/IR/Checker/IRChecker.cpp:417: void SanityChecker::checkSrc(const iga::Instruction&, int): Assertion `false && (ss.str().c_str())' failed.

[3474666] signal (6.-6): Aborted
in expression starting at /home/tim/Julia/pkg/oneAPI/dev/wip.jl:7
unknown function (ip: 0x7fd4b93a9e2c)
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fd4b9345394)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
checkSrc at /workspace/srcdir/intel-graphics-compiler/visa/iga/IGALibrary/IR/Checker/IRChecker.cpp:417
checkInstruction at /workspace/srcdir/intel-graphics-compiler/visa/iga/IGALibrary/IR/Checker/IRChecker.cpp:368
SanityCheckIR at /workspace/srcdir/intel-graphics-compiler/visa/iga/IGALibrary/IR/Checker/IRChecker.cpp:430
validate at /workspace/srcdir/intel-graphics-compiler/visa/iga/IGALibrary/IR/Instruction.cpp:175
Encode at /workspace/srcdir/intel-graphics-compiler/visa/BinaryEncodingIGA.cpp:1160
EncodeKernelIGA at /workspace/srcdir/intel-graphics-compiler/visa/BinaryEncodingIGA.cpp:2098
encodeAndEmit at /workspace/srcdir/intel-graphics-compiler/visa/VISAKernelImpl.cpp:347
Compile at /workspace/srcdir/intel-graphics-compiler/visa/BuildCISAIRImpl.cpp:2044
Compile at /workspace/srcdir/intel-graphics-compiler/IGC/Compiler/CISACodeGen/CISABuilder.cpp:6263
runOnFunction at /workspace/srcdir/intel-graphics-compiler/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp:1309
runOnFunction at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/lib/IR/LegacyPassManager.cpp:1434
runOnModule at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/lib/IR/LegacyPassManager.cpp:1480
runOnModule at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/lib/IR/LegacyPassManager.cpp:1549
run at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/lib/IR/LegacyPassManager.cpp:539
run at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/lib/IR/LegacyPassManager.cpp:1676
CodeGen at /workspace/srcdir/intel-graphics-compiler/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp:3341
CodeGen at /workspace/srcdir/intel-graphics-compiler/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp:3367
TranslateBuildSPMD at /workspace/srcdir/intel-graphics-compiler/IGC/AdaptorOCL/dllInterfaceCompute.cpp:1508
TranslateBuildSPMDAndESIMD at /workspace/srcdir/intel-graphics-compiler/IGC/VISALinkerDriver/VLD.cpp:367
TranslateBuild at /workspace/srcdir/intel-graphics-compiler/IGC/AdaptorOCL/dllInterfaceCompute.cpp:1761
Translate at /workspace/srcdir/intel-graphics-compiler/IGC/AdaptorOCL/ocl_igc_interface/impl/igc_ocl_translation_ctx_impl.h:359
TranslateImpl at /workspace/srcdir/intel-graphics-compiler/IGC/AdaptorOCL/ocl_igc_interface/impl/igc_ocl_translation_ctx_impl.cpp:68
Translate<> at /workspace/destdir/include/igc/ocl_igc_interface/igc_ocl_translation_ctx.h:93
translate<IGC::IgcOclTranslationCtx<3> > at /workspace/srcdir/compute-runtime/shared/source/compiler_interface/compiler_interface.inl:75
build at /workspace/srcdir/compute-runtime/shared/source/compiler_interface/compiler_interface.cpp:153
compileGenBinary at /workspace/srcdir/compute-runtime/level_zero/core/source/module/module_imp.cpp:207
buildFromSpirV at /workspace/srcdir/compute-runtime/level_zero/core/source/module/module_imp.cpp:290
initializeTranslationUnit at /workspace/srcdir/compute-runtime/level_zero/core/source/module/module_imp.cpp:734
initialize at /workspace/srcdir/compute-runtime/level_zero/core/source/module/module_imp.cpp:536
create at /workspace/srcdir/compute-runtime/level_zero/core/source/module/module_imp.cpp:1229
createModule at /workspace/srcdir/compute-runtime/level_zero/core/source/device/device_imp.cpp:481
createModule at /workspace/srcdir/compute-runtime/level_zero/core/source/context/context_imp.cpp:935
zeModuleCreate at /workspace/srcdir/compute-runtime/level_zero/api/core/ze_module_api_entrypoints.h:23