llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.26k stars 11.67k forks source link

[FatLTO][UnifiedLTO] Unified lto pipeline sometimes misses running LowerMatrixIntrinsicsPass #77621

Closed mandlebug closed 8 months ago

mandlebug commented 8 months ago

Problem is exposed when using -fenable-matrix with either -ffat-lto-objects or -funified-lto and performing a full lto link step. The matrix-types-spec test from test-site is a good example of the failure.

Eg for fat lto

clang++ -DNDEBUG  -O3 -fomit-frame-pointer -flto -ffat-lto-objects -fenable-matrix -o SingleSource/UnitTests/CMakeFiles/matrix-types-spec.dir/matrix-types-spec.cpp.o -c <testsuite-path>/SingleSource/UnitTests/matrix-types-spec.cpp

clang++ -O3 -fomit-frame-pointer -flto -ffat-lto-objects -fno-split-lto-unit -DNDEBUG -fenable-matrix SingleSource/UnitTests/CMakeFiles/matrix-types-spec.dir/matrix-types-spec.cpp.o -o SingleSource/UnitTests/matrix-types-spec

Link step crashes with the following output:

WidenVectorResult #0: t132: v9f64,ch = llvm.matrix.column.major.load t639, TargetConstant:i64<211>, FrameIndex:i64<33>, Constant:i64<3>, TargetConstant:i1<0>, TargetConstant:i32<3>, TargetConstant:i
32<3>                                                                                                                                                                                                 

LLVM ERROR: Do not know how to widen the result of this operator!      
mandlebug commented 8 months ago

@ilovepi @ormris

ormris commented 8 months ago

Looks like the -enable-matrix flag isn't being passed to the LTO driver. PR to follow.

llvmbot commented 8 months ago

@llvm/issue-subscribers-clang-driver

Author: Sean Fertile (mandlebug)

Problem is exposed when using `-fenable-matrix` with either `-ffat-lto-objects` or `-funified-lto` and performing a full lto link step. The `matrix-types-spec` test from test-site is a good example of the failure. Eg for fat lto ``` clang++ -DNDEBUG -O3 -fomit-frame-pointer -flto -ffat-lto-objects -fenable-matrix -o SingleSource/UnitTests/CMakeFiles/matrix-types-spec.dir/matrix-types-spec.cpp.o -c <testsuite-path>/SingleSource/UnitTests/matrix-types-spec.cpp clang++ -O3 -fomit-frame-pointer -flto -ffat-lto-objects -fno-split-lto-unit -DNDEBUG -fenable-matrix SingleSource/UnitTests/CMakeFiles/matrix-types-spec.dir/matrix-types-spec.cpp.o -o SingleSource/UnitTests/matrix-types-spec ``` Link step crashes with the following output: ``` WidenVectorResult #0: t132: v9f64,ch = llvm.matrix.column.major.load t639, TargetConstant:i64<211>, FrameIndex:i64<33>, Constant:i64<3>, TargetConstant:i1<0>, TargetConstant:i32<3>, TargetConstant:i 32<3> LLVM ERROR: Do not know how to widen the result of this operator! ```