intel / intel-graphics-compiler

Other
605 stars 158 forks source link

LLVM 15: no member named 'getElementType' in 'llvm::PointerType' #258

Closed frantisekz closed 1 year ago

frantisekz commented 2 years ago

There are bunch of no member named 'getElementType' in 'llvm::PointerType' errors when compiling against LLVM 15:

FAILED: IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetric.cpp.o 
/usr/bin/clang++ -DCL_KHR_FP64_EXT -DGHAL3D=USC -DICBE_LINUX -DIGC_CMAKE -DIGC_EXPORTS=1 -DIGC_SPIRV_ENABLED -DIGC_SPIRV_TOOLS_ENABLED -DIGC_VC_ENABLED -DINSIDE_PLUGIN -DISTDLIB_UMD -DLINUX -DLLVM_VERSION_MAJOR=15 -DNDEBUG -DNOMINMAX -DSTD_CALL -DUSC_EXPORTS=1 -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -DUSE_SSSE3 -D_AMD64_ -D_COMPILER_DLL_ -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_IGC_ -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/autogen -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../Common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../3d/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/API -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../visa/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/Release -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/ocl_igc_shared/executable_format -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/AdaptorOCL/ocl_igc_interface/impl -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/cif/cif/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source/autogen -I/include -I/usr/lib64/cmake/SPIRV-Tools../../../include -flto -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-everything -Qunused-arguments -fexceptions -O2 -fmessage-length=0 -march=corei7 -mstackrealign -fms-extensions -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Wno-long-long -Wswitch -Wno-sign-compare -Wno-unused-result -Wno-enum-compare -Wno-type-limits -Wno-ignored-qualifiers -Wno-shadow -Wformat -Wformat-security -Wno-extra -Wno-write-strings -finline -fno-strict-aliasing -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -Wno-unknown-pragmas -fPIC -Bsymbolic -D_FORTIFY_SOURCE=2 -fstack-protector -finline-functions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -g -std=gnu++17 -MD -MT IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetric.cpp.o -MF IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetric.cpp.o.d -o IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetric.cpp.o -c /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetric.cpp
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetric.cpp:10:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetricImpl.h:29:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/CVariable.hpp:11:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/CISACodeGen.h:10:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CodeGenPublic.h:28:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/helper.h:23:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h:337:65: error: no member named 'getElementType' in 'llvm::PointerType'
                llvm::cast<llvm::PointerType>(Func->getType())->getElementType()),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.

...

FAILED: IGC/GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o 
/usr/bin/clang++ -DCL_KHR_FP64_EXT -DGHAL3D=USC -DICBE_LINUX -DIGC_CMAKE -DIGC_EXPORTS=1 -DIGC_SPIRV_ENABLED -DIGC_SPIRV_TOOLS_ENABLED -DIGC_VC_ENABLED -DINSIDE_PLUGIN -DISTDLIB_UMD -DLINUX -DLLVM_VERSION_MAJOR=15 -DNDEBUG -DNOMINMAX -DSTD_CALL -DUSC_EXPORTS=1 -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -DUSE_SSSE3 -D_AMD64_ -D_COMPILER_DLL_ -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_IGC_ -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/autogen -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../Common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../3d/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/API -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../visa/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/Release -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/ocl_igc_shared/executable_format -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/AdaptorOCL/ocl_igc_interface/impl -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/cif/cif/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source/autogen -I/include -I/usr/lib64/cmake/SPIRV-Tools../../../include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/GenISAIntrinsics -flto -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-everything -Qunused-arguments -fexceptions -O2 -fmessage-length=0 -march=corei7 -mstackrealign -fms-extensions -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Wno-long-long -Wswitch -Wno-sign-compare -Wno-unused-result -Wno-enum-compare -Wno-type-limits -Wno-ignored-qualifiers -Wno-shadow -Wformat -Wformat-security -Wno-extra -Wno-write-strings -finline -fno-strict-aliasing -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -Wno-unknown-pragmas -fPIC -Bsymbolic -D_FORTIFY_SOURCE=2 -fstack-protector -finline-functions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -g -std=gnu++17 -MD -MT IGC/GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o -MF IGC/GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o.d -o IGC/GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o -c /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/GenISAIntrinsics/GenIntrinsics.cpp
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/GenISAIntrinsics/GenIntrinsics.cpp:9:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CodeGenPublic.h:28:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/helper.h:23:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h:337:65: error: no member named 'getElementType' in 'llvm::PointerType'
                llvm::cast<llvm::PointerType>(Func->getType())->getElementType()),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.

...

FAILED: IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetricImpl.cpp.o 
/usr/bin/clang++ -DCL_KHR_FP64_EXT -DGHAL3D=USC -DICBE_LINUX -DIGC_CMAKE -DIGC_EXPORTS=1 -DIGC_SPIRV_ENABLED -DIGC_SPIRV_TOOLS_ENABLED -DIGC_VC_ENABLED -DINSIDE_PLUGIN -DISTDLIB_UMD -DLINUX -DLLVM_VERSION_MAJOR=15 -DNDEBUG -DNOMINMAX -DSTD_CALL -DUSC_EXPORTS=1 -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -DUSE_SSSE3 -D_AMD64_ -D_COMPILER_DLL_ -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_IGC_ -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/autogen -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../Common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../3d/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/API -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../visa/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/Release -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/ocl_igc_shared/executable_format -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/AdaptorOCL/ocl_igc_interface/impl -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/cif/cif/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source/autogen -I/include -I/usr/lib64/cmake/SPIRV-Tools../../../include -flto -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-everything -Qunused-arguments -fexceptions -O2 -fmessage-length=0 -march=corei7 -mstackrealign -fms-extensions -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Wno-long-long -Wswitch -Wno-sign-compare -Wno-unused-result -Wno-enum-compare -Wno-type-limits -Wno-ignored-qualifiers -Wno-shadow -Wformat -Wformat-security -Wno-extra -Wno-write-strings -finline -fno-strict-aliasing -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -Wno-unknown-pragmas -fPIC -Bsymbolic -D_FORTIFY_SOURCE=2 -fstack-protector -finline-functions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -g -std=gnu++17 -MD -MT IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetricImpl.cpp.o -MF IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetricImpl.cpp.o.d -o IGC/CMakeFiles/igc_metric.dir/Metrics/IGCMetricImpl.cpp.o -c /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetricImpl.cpp
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetricImpl.cpp:17:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Metrics/IGCMetricImpl.h:29:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/CVariable.hpp:11:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/CISACodeGen.h:10:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CodeGenPublic.h:28:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/Compiler/CISACodeGen/helper.h:23:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h:337:65: error: no member named 'getElementType' in 'llvm::PointerType'
                llvm::cast<llvm::PointerType>(Func->getType())->getElementType()),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.

and error: use of undeclared identifier 'SimplifyInstruction'; did you mean 'simplifyInstruction'?

FAILED: IGC/VectorCompiler/lib/GenXOpts/CMakeFiles/VCTransforms.dir/CMAnalysis/InstructionSimplifyGenX.cpp.o 
/usr/bin/clang++ -DCL_KHR_FP64_EXT -DGHAL3D=USC -DICBE_LINUX -DIGC_CMAKE -DIGC_EXPORTS=1 -DIGC_SPIRV_ENABLED -DIGC_SPIRV_TOOLS_ENABLED -DIGC_VC_ENABLED -DINSIDE_PLUGIN -DISTDLIB_UMD -DLINUX -DLLVM_VERSION_MAJOR=15 -DNDEBUG -DNOMINMAX -DSTD_CALL -DUSC_EXPORTS=1 -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -DUSE_SSSE3 -D_AMD64_ -D_COMPILER_DLL_ -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_IGC_ -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/autogen -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../Common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../3d/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/API -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../visa/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/Release -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/ocl_igc_shared/executable_format -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/AdaptorOCL/ocl_igc_interface/impl -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/../inc/common/Compiler/common -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/AdaptorOCL/cif/cif/.. -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/ZEBinWriter/zebin/source/autogen -I/include -I/usr/lib64/cmake/SPIRV-Tools../../../include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/VectorCompiler/include -I/builddir/build/BUILD/vc-intrinsics-56481cacb393cf82202b5228cba26440afa42a14/GenXIntrinsics/include -I/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/redhat-linux-build/IGC/VectorCompiler/intrbuild/lib/GenXIntrinsics/../../include -flto -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-everything -Qunused-arguments -fexceptions -O2 -fmessage-length=0 -march=corei7 -mstackrealign -fms-extensions -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Wno-long-long -Wswitch -Wno-sign-compare -Wno-unused-result -Wno-enum-compare -Wno-type-limits -Wno-ignored-qualifiers -Wno-shadow -Wformat -Wformat-security -Wno-extra -Wno-write-strings -finline -fno-strict-aliasing -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -Wno-unknown-pragmas -fPIC -Bsymbolic -D_FORTIFY_SOURCE=2 -fstack-protector -finline-functions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -g -std=gnu++17 -MD -MT IGC/VectorCompiler/lib/GenXOpts/CMakeFiles/VCTransforms.dir/CMAnalysis/InstructionSimplifyGenX.cpp.o -MF IGC/VectorCompiler/lib/GenXOpts/CMakeFiles/VCTransforms.dir/CMAnalysis/InstructionSimplifyGenX.cpp.o.d -o IGC/VectorCompiler/lib/GenXOpts/CMakeFiles/VCTransforms.dir/CMAnalysis/InstructionSimplifyGenX.cpp.o -c /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMAnalysis/InstructionSimplifyGenX.cpp
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMAnalysis/InstructionSimplifyGenX.cpp:467:22: error: use of undeclared identifier 'SimplifyInstruction'; did you mean 'simplifyInstruction'?
      if (Value *V = SimplifyInstruction(Inst, DL)) {
                     ^~~~~~~~~~~~~~~~~~~
                     simplifyInstruction
/usr/include/llvm/Analysis/InstructionSimplify.h:319:8: note: 'simplifyInstruction' declared here
Value *simplifyInstruction(Instruction *I, const SimplifyQuery &Q,
       ^
1 error generated.
frantisekz commented 2 years ago

There'll be probably some more errors down the road, I didn't have a chance to dig more into it. Reported what the initial attempt ended up with.

frantisekz commented 2 years ago

So, for the first batch of errors around getElementType, just changing to getPointerElementType should be enough (ref. https://github.com/intel/intel-graphics-compiler/commit/49f4d4e3e904179bf3a0b880732b92f8bfb2c64a ):

--- a/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h
@@ -334,7 +334,7 @@ namespace IGCLLVM
                 Func, Args, Bundles, NameStr, InsertBefore);
 #else
             return llvm::IRBuilder<T, InserterTyDef()>::Create(llvm::cast<llvm::FunctionType>(
-                llvm::cast<llvm::PointerType>(Func->getType())->getElementType()),
+                llvm::cast<llvm::PointerType>(Func->getType())->getPointerElementType()),
                 Func, Args, Bundles, NameStr, InsertBefore);
 #endif
         }
-- 

simplifyInstruction is a drop-in replacement for SimplifyInstruction, ref: https://github.com/llvm/llvm-project/commit/b8c2781ff60126b8c7c11ed0dab90d0640a17d4f

There are, of course bunch of more errors down the road:

/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/DebugInfo.cpp:112:30: error: no member named 'DW_TAG_base_type' in namespace 'llvm::dwarf'
      M.getContext(), dwarf::DW_TAG_base_type, ("ui" + Twine(SizeInBits)).str(),
                      ~~~~~~~^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/DebugInfo.cpp:113:39: error: no member named 'DW_ATE_unsigned' in namespace 'llvm::dwarf'
      SizeInBits, 0 /*Align*/, dwarf::DW_ATE_unsigned, DINode::FlagZero);
                               ~~~~~~~^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/DebugInfo.cpp:139:19: error: no member named 'DW_TAG_array_type' in namespace 'llvm::dwarf'
      Ctx, dwarf::DW_TAG_array_type, "" /*Name*/, nullptr /*File*/, 0 /*Line*/,
           ~~~~~~~^
3 errors generated.
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/InstRebuilder.cpp:13:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/Support/Alignment.h:86:32: error: no member named 'getAlignment' in 'llvm::LoadInst'
        return llvm::Align(Val.getAlignment());
                           ~~~ ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/InstRebuilder.cpp:102:31: note: in instantiation of function template specialization 'IGCLLVM::getAlign<llvm::LoadInst, 0>' requested here
                     IGCLLVM::getAlign(OrigLoad),
                              ^
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/InstRebuilder.cpp:13:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/Support/Alignment.h:86:32: error: no member named 'getAlignment' in 'llvm::StoreInst'
        return llvm::Align(Val.getAlignment());
                           ~~~ ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/Utils/General/InstRebuilder.cpp:111:60: note: in instantiation of function template specialization 'IGCLLVM::getAlign<llvm::StoreInst, 0>' requested here
                         OrigStore.isVolatile(),  IGCLLVM::getAlign(OrigStore),
                                                           ^
2 errors generated.
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:977:24: error: no member named 'getAlignment' in 'llvm::LoadInst'; did you mean 'getAlign'?
      auto Align = LI->getAlignment();
                       ^~~~~~~~~~~~
                       getAlign
/usr/include/llvm/IR/Instructions.h:217:9: note: 'getAlign' declared here
  Align getAlign() const {
        ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:978:49: error: no viable conversion from 'llvm::Align' to 'unsigned int'
      pReplacedInst = B->MASKED_GATHER(pVecSrc, Align);
                                                ^~~~~
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/gen_builder.hpp:153:47: note: passing argument to parameter 'Align' here
CallInst* MASKED_GATHER(Value *Ptrs, unsigned Align, Value *Mask = nullptr, Value *PassThru = nullptr, const Twine& Name = "")
                                              ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:992:44: error: no member named 'getAlignment' in 'llvm::StoreInst'; did you mean 'getAlign'?
      auto Align = cast<StoreInst>(pInst)->getAlignment();
                                           ^~~~~~~~~~~~
                                           getAlign
/usr/include/llvm/IR/Instructions.h:342:9: note: 'getAlign' declared here
  Align getAlign() const {
        ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:993:63: error: no viable conversion from 'llvm::Align' to 'unsigned int'
      pReplacedInst = B->MASKED_SCATTER(pVecSrc, pVecDstPtrs, Align);
                                                              ^~~~~
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/gen_builder.hpp:158:60: note: passing argument to parameter 'Align' here
CallInst* MASKED_SCATTER(Value *Val, Value *Ptrs, unsigned Align, Value *Mask = nullptr)
                                                           ^
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:21:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/PacketBuilder.h:20:
In file included from /builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/IR/IRBuilder.h:15:
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/WrapperLLVM/include/llvmWrapper/Support/Alignment.h:86:32: error: no member named 'getAlignment' in 'llvm::LoadInst'
        return llvm::Align(Val.getAlignment());
                           ~~~ ^
/builddir/build/BUILD/intel-graphics-compiler-igc-1.0.12149.1/IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp:980:57: note: in instantiation of function template specialization 'IGCLLVM::getAlign<llvm::LoadInst, 0>' requested here
      pReplacedInst = B->ALIGNED_LOAD(pVecSrc, IGCLLVM::getAlign(*LI));
                                                        ^
5 errors generated.
pszymich commented 2 years ago

Thank you @frantisekz for you investigation. We have started work on integrating LLVM 15 support in parallel to driving LLVM 14 based IGC conformance up to production level. You should see patches with LLVM 15 oriented fixes appearing in the project in a short while.

abderraouf-adjal commented 2 years ago

@pszymich any updates on the issue?

AGindinson commented 2 years ago

@pszymich any updates on the issue?

Hi @abderraouf-adjal, there has been some progress over the last 3 weeks, namely commits ce43a7923cb960d3fce5130b0e8de481b5bbb7df and 75a6663f877618fd88d67c7c0ff9e21e6011a243. I'm currently chugging away at the errors related to Align and dwarf:: enum values, with getPointerElementType fixes right around the corner. More commits should be getting in over the next 2-3 weeks.

frantisekz commented 2 years ago

@AGindinson

I took bunch of your commits, applied them on top of the latest tag and tried to get a bit further, adding here my patches (take it with grain of salt, I am python programmer :) ), if it saves you some time:

--- a/IGC/Compiler/Optimizer/OpenCLPasses/AlignmentAnalysis/AlignmentAnalysis.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AlignmentAnalysis/AlignmentAnalysis.cpp
@@ -518,7 +518,11 @@ void AlignmentAnalysis::SetInstAlignment(MemSetInst& I)
 {
     // Set the align attribute of the memset according to the detected
     // alignment of its operand.
-#if LLVM_VERSION_MAJOR >= 14
+#if LLVM_VERSION_MAJOR >= 15
+    uint64_t alignment_value = getAlignValue(I.getRawDest());
+    llvm::Align alignment = std::max(I.getDestAlign().valueOrOne(), llvm::Align(alignment_value));
+    I.setDestAlignment(alignment);
+#elif LLVM_VERSION_MAJOR >= 14
     uint64_t alignment_value = getAlignValue(I.getRawDest());
     llvm::Align alignment = llvm::max(I.getDestAlign(), llvm::Align(alignment_value));
     I.setDestAlignment(alignment);
@@ -545,7 +549,11 @@ void AlignmentAnalysis::SetInstAlignment(MemCpyInst& I)
 void AlignmentAnalysis::SetInstAlignment(MemMoveInst& I)
 {
     // Set the align attribute of the memmove based on the minimum alignment of its source and dest fields
-#if LLVM_VERSION_MAJOR >= 14
+#if LLVM_VERSION_MAJOR >= 15
+    uint64_t alignment_value = iSTD::Min(getAlignValue(I.getRawDest()), getAlignValue(I.getRawSource()));
+    llvm::Align alignment = std::max(I.getDestAlign().valueOrOne(), llvm::Align(alignment_value));
+    I.setDestAlignment(alignment);
+#elif LLVM_VERSION_MAJOR >= 14
     uint64_t alignment_value = iSTD::Min(getAlignValue(I.getRawDest()), getAlignValue(I.getRawSource()));
     llvm::Align alignment = llvm::max(I.getDestAlign(), llvm::Align(alignment_value));
     I.setDestAlignment(alignment);
-- 
--- a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
@@ -26,7 +26,7 @@ namespace IGCLLVM
     {
         return llvm::createLoopUnrollPass(OptLevel, false, Threshold, Count, AllowPartial, Runtime, UpperBound, AllowPeeling);
     }
-#elif LLVM_VERSION_MAJOR >= 9 && LLVM_VERSION_MAJOR <= 14
+#elif LLVM_VERSION_MAJOR >= 9 && LLVM_VERSION_MAJOR <= 15
     inline static llvm::Pass * createLoopUnrollPass(
         int OptLevel = 2, int Threshold = -1, int Count = -1,
         int AllowPartial = -1, int Runtime = -1,
-- 
--- a/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.cpp
+++ b/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.cpp
@@ -157,7 +157,7 @@ void initializeGenXPasses(PassRegistry &registry) {
   // WRITE HERE MORE PASSES IF IT'S NEEDED;
 }

-TargetTransformInfo GenXTargetMachine::getTargetTransformInfo(const Function &F) {
+TargetTransformInfo GenXTargetMachine::getTargetTransformInfo(const Function &F) const {
   GenXTTIImpl GTTI(F.getParent()->getDataLayout(), *BC);
   return TargetTransformInfo(GTTI);
 }
diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h b/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
index 8a6f71d..f8d87d3 100644
--- a/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
+++ b/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
@@ -75,7 +75,7 @@ public:
   const TargetSubtargetInfo *getSubtargetImpl(const Function &) const override {
     return &Subtarget;
   }
-  TargetTransformInfo getTargetTransformInfo(const Function &F) override;
+  TargetTransformInfo getTargetTransformInfo(const Function &F) const override;

   const GenXSubtarget &getGenXSubtarget() const { return Subtarget; }
 };
-- 
--- a/IGC/VectorCompiler/lib/Driver/Driver.cpp
+++ b/IGC/VectorCompiler/lib/Driver/Driver.cpp
@@ -342,8 +342,6 @@ static void optimizeIR(const vc::CompileOptions &Opts,
   PMBuilder.LoopVectorize = false;
   PMBuilder.DisableUnrollLoops = false;
   PMBuilder.MergeFunctions = false;
-  PMBuilder.PrepareForThinLTO = false;
-  PMBuilder.PrepareForLTO = false;
   PMBuilder.RerollLoops = true;

   TM.adjustPassManager(PMBuilder);
-- 
--- a/IGC/BiFModule/CMakeLists.txt
+++ b/IGC/BiFModule/CMakeLists.txt
@@ -251,7 +251,7 @@ function(igc_bif_build_bc)
     add_custom_command(
         OUTPUT "${_bcTempFilePath}"
         COMMAND "${CMAKE_COMMAND}" -E compare_files ${BiFModule_PREBUILD_SHA_PATH} ${BiFModule_SRC_SHA_PATH} || "${CMAKE_COMMAND}" -E make_directory "${_outBcFileDir}"
-        COMMAND "${CMAKE_COMMAND}" -E compare_files ${BiFModule_PREBUILD_SHA_PATH} ${BiFModule_SRC_SHA_PATH} || "$<TARGET_FILE:clang-tool>" -cc1 -x cl -fblocks -fpreserve-vec3-type -opencl-builtins "-triple=${_archTriple}" -w -emit-llvm-bc -o "${_bcTempFilePath}" ${_pchFlags} ${_incFileFlags} ${_includeDirsFlags} ${_defineFlags} ${_options_DEFAULT} ${_options_CL} "${_srcFilePath}"
+        COMMAND "${CMAKE_COMMAND}" -E compare_files ${BiFModule_PREBUILD_SHA_PATH} ${BiFModule_SRC_SHA_PATH} || "$<TARGET_FILE:clang-tool>" -cc1 -x cl -fblocks -fpreserve-vec3-type -opencl-builtins "-triple=${_archTriple}" -Wno-int-conversion -w -emit-llvm-bc -o "${_bcTempFilePath}" ${_pchFlags} ${_incFileFlags} ${_includeDirsFlags} ${_defineFlags} ${_options_DEFAULT} ${_options_CL} "${_srcFilePath}"
         DEPENDS clang-tool ${_pchFilePath} ${_incFilePaths} "${_srcFilePath}" ${_dependencies}
         COMMENT "BiF: \"${_outBcFileName}\": Compiling OpenCL source: \"${_srcFileName}\""
       )
-- 

This got it to the point where elf_packager call around the half of the compilation crashes with SIGSEGV (tried with and without LTO).

pszymich commented 2 years ago

Hi @frantisekz, many thanks for the help! Could you move your patches to a pull-request? We'll review them there. Thanks!

AGindinson commented 2 years ago

Hi @frantisekz,

Thank you! All patches but the last one seem to match my findings, and I have PRs underway for that (with minor edits to account for LLVM versioning). The BiFModule issue isn't something I've stumbled upon yet, so backing @pszymich's ask for a PR here - it would be all the more helpful.

frantisekz commented 2 years ago

Hi @frantisekz,

Thank you! All patches but the last one seem to match my findings, and I have PRs underway for that (with minor edits to account for LLVM versioning). The BiFModule issue isn't something I've stumbled upon yet, so backing @pszymich's ask for a PR here - it would be all the more helpful.

Here you go :) : https://github.com/intel/intel-graphics-compiler/pull/262

pszymich commented 1 year ago

Hi, commit b86c1bf9124576473c96e05721a59c6470a19c7e solves the original problem. Thanks @AGindinson!

For other LLVM 15 related sightings please create new issue. Thanks!

frantisekz commented 1 year ago

Thanks @AGindinson and @pszymich , will create issues as I pget further with compilation, here is the current roadblock: https://github.com/intel/intel-graphics-compiler/issues/263