Hi Slava,

This regression may not be a real regression but a latent bug.

The attached test.f90 is a simplified reproducer.

If I run the following command using LLVM built with assertion enabled,

flang -c -target aarch64-unknown-linux-gnu -O2 -ffast-math -march=armv8.2-a+sve 
-msve-vector-bits=256 -flto test.f90 -o test.bc
flang -target aarch64-unknown-linux-gnu -O2 -ffast-math -march=armv8.2-a+sve 
-msve-vector-bits=256 -flto -fuse-ld=lld test.bc

I get the following assertion failure.

----------------------------------------------------------------
ld.lld: 
llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:3722: 
llvm::SDValue 
llvm::DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(llvm::SDNode*): Assertion 
`IdxVal + SubVT.getVectorMinNumElements() <= LoEltsMin && "Extracted subvector 
crosses vector split!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and 
include the crash backtrace.
Stack dump:
0.      Program arguments: llvm/bin/ld.lld -EL -z relro --hash-style=gnu 
--eh-frame-hdr -m aarch64linux -pie -dynamic-linker /lib/ld-linux-aarch64.so.1 
-o a.out /lib/aarch64-linux-gnu/Scrt1.o /lib/aarch64-linux-gnu/crti.o 
/usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o 
/usr/lib/gcc/aarch64-linux-gnu/13/crtfastmath.o 
-Lllvm/bin/../lib/aarch64-unknown-linux-gnu 
-Lllvm/lib/clang/21/lib/aarch64-unknown-linux-gnu 
-L/usr/lib/gcc/aarch64-linux-gnu/13 -L/lib/aarch64-linux-gnu 
-L/usr/lib/aarch64-linux-gnu -L/lib -L/usr/lib -plugin-opt=mcpu=generic 
-plugin-opt=O2 -plugin-opt=-enable-tlsdesc /tmp/test-074bef.o -Lllvm/lib 
-lflang_rt.runtime -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc 
--as-needed -lgcc_s --no-as-needed /usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o 
/lib/aarch64-linux-gnu/crtn.o
1.      Running pass 'Function Pass Manager' on module 'ld-temp.o'.
2.      Running pass 'AArch64 Instruction Selection' on function '@main'
 #0 0x0000ffff9c9cdbd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(llvm/lib/libLLVMSupport.so.21.0git+0x25dbd8)
 #1 0x0000ffff9c9cb2c0 llvm::sys::RunSignalHandlers() 
(llvm/lib/libLLVMSupport.so.21.0git+0x25b2c0)
 #2 0x0000ffff9c9cb428 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x0000ffff9d2c07f0 (linux-vdso.so.1+0x7f0)
 #4 0x0000ffff9c3a7608 (/lib/aarch64-linux-gnu/libc.so.6+0x87608)
 #5 0x0000ffff9c35cb3c raise (/lib/aarch64-linux-gnu/libc.so.6+0x3cb3c)
 #6 0x0000ffff9c347e00 abort (/lib/aarch64-linux-gnu/libc.so.6+0x27e00)
 #7 0x0000ffff9c355cc0 (/lib/aarch64-linux-gnu/libc.so.6+0x35cc0)
 #8 0x0000ffff9c355d30 __assert_perror_fail 
(/lib/aarch64-linux-gnu/libc.so.6+0x35d30)
 #9 0x0000ffff97a88cd4 
llvm::DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(llvm::SDNode*) 
LegalizeVectorTypes.cpp:0:0
#10 0x0000ffff97a8fb88 
llvm::DAGTypeLegalizer::SplitVectorOperand(llvm::SDNode*, unsigned int) 
LegalizeVectorTypes.cpp:0:0
#11 0x0000ffff97a58df4 llvm::DAGTypeLegalizer::run() LegalizeTypes.cpp:0:0
#12 0x0000ffff97a59ad4 llvm::SelectionDAG::LegalizeTypes() 
(llvm/lib/libLLVMSelectionDAG.so.21.0git+0x299ad4)
#13 0x0000ffff97bccbfc llvm::SelectionDAGISel::CodeGenAndEmitDAG() 
(llvm/lib/libLLVMSelectionDAG.so.21.0git+0x40cbfc)
#14 0x0000ffff97bd00a4 
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) 
(llvm/lib/libLLVMSelectionDAG.so.21.0git+0x4100a4)
#15 0x0000ffff97bd16d4 
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) 
(llvm/lib/libLLVMSelectionDAG.so.21.0git+0x4116d4)
#16 0x0000ffff97bbe20c 
llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) 
(llvm/lib/libLLVMSelectionDAG.so.21.0git+0x3fe20c)
#17 0x0000ffff989d6eb0 
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) 
MachineFunctionPass.cpp:0:0
#18 0x0000ffff992eec18 llvm::FPPassManager::runOnFunction(llvm::Function&) 
(llvm/lib/libLLVMCore.so.21.0git+0x49ec18)
#19 0x0000ffff992eee1c llvm::FPPassManager::runOnModule(llvm::Module&) 
(llvm/lib/libLLVMCore.so.21.0git+0x49ee1c)
#20 0x0000ffff992efa80 llvm::legacy::PassManagerImpl::run(llvm::Module&) 
(llvm/lib/libLLVMCore.so.21.0git+0x49fa80)
#21 0x0000ffff9ae3dcb8 codegen(llvm::lto::Config const&, llvm::TargetMachine*, 
std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, 
std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine 
const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex const&) 
LTOBackend.cpp:0:0
#22 0x0000ffff9ae3f1ac llvm::lto::backend(llvm::lto::Config const&, 
std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, 
std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine 
const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) 
(llvm/lib/libLLVMLTO.so.21.0git+0x6f1ac)
#23 0x0000ffff9ae30958 
llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream,
 std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine 
const&)>) (llvm/lib/libLLVMLTO.so.21.0git+0x60958)
#24 0x0000ffff9ae341e4 
llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream,
 std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine 
const&)>, llvm::FileCache) (llvm/lib/libLLVMLTO.so.21.0git+0x641e4)
#25 0x0000ffff9d110f74 lld::elf::BitcodeCompiler::compile() 
(llvm/lib/liblldELF.so.21.0git+0x220f74)
#26 0x0000ffff9d06fb50 void 
lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1,
 true>>(bool) (llvm/lib/liblldELF.so.21.0git+0x17fb50)
#27 0x0000ffff9d08f0e8 void 
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, 
true>>(llvm::opt::InputArgList&) (llvm/lib/liblldELF.so.21.0git+0x19f0e8)
#28 0x0000ffff9d093694 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char 
const*>) (llvm/lib/liblldELF.so.21.0git+0x1a3694)
#29 0x0000ffff9d0949a4 lld::elf::link(llvm::ArrayRef<char const*>, 
llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) 
(llvm/lib/liblldELF.so.21.0git+0x1a49a4)
#30 0x0000ffff9ca674bc lld::unsafeLldMain(llvm::ArrayRef<char const*>, 
llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) 
(llvm/lib/liblldCommon.so.21.0git+0x274bc)
#31 0x0000aaaae10c2734 lld_main(int, char**, llvm::ToolContext const&) 
(llvm/bin/ld.lld+0x12734)
#32 0x0000aaaae10c2a00 main (llvm/bin/ld.lld+0x12a00)
#33 0x0000ffff9c3484c4 (/lib/aarch64-linux-gnu/libc.so.6+0x284c4)
#34 0x0000ffff9c348598 __libc_start_main 
(/lib/aarch64-linux-gnu/libc.so.6+0x28598)
#35 0x0000aaaae10c2070 _start (llvm/bin/ld.lld+0x12070)
flang-21: error: unable to execute command: Aborted (core dumped)
flang-21: error: linker command failed due to signal (use -v to see invocation)
----------------------------------------------------------------

I've confirmed this assertion failure using this simplified reproducer occurs 
with earlier LLVM revisions.

> Hi Slava,
> 
> I looked through bisection logs and could not find any issues with the 
> bisection.
> 
> The commit history is this:
> 
> 2d12d31f44acac54d7b2858624cb8a1db5a0a8ce - FAIL
> 3aad7d7a3ce57bc06b3cd08df8030064da97bf4e - PASS
> 6dc6ca3302edadad7d4b195a05038995b84606d0 - UNTESTED
> 
> These tests don't fail for commit 3aad7d7a3ce57bc06b3cd08df8030064da97bf4e 
> (also yours) and fail for 2d12d31f44acac54d7b2858624cb8a1db5a0a8ce.  See 
> results in [1] and [2].
> 
> I don't have ready results for 6dc6ca3302edadad7d4b195a05038995b84606d0.  
> Could you please double check that these tests FAIL for you for the immediate 
> parent of llvmorg-21-init-11733-g2d12d31f44ac -- 
> 3aad7d7a3ce57bc06b3cd08df8030064da97bf4e ?
> 
> The only other data point I have is that these tests PASSed in 
> cf3242f3b0f6eec47786426777f6e0b18363caa1, which is 8 commits before yours.
> 
> Finally, are you using below flags in your testing?  In particular "-flto 
> -fuse-ld=lld"?  Error in [3] happens during LTO processing.
> 
> > -O3 -ffast-math -march=armv8.4-a+sve -msve-vector-bits=256 -mllvm 
> > -treat-scalable-fixed-error-as-warning=false -flto -fuse-ld=lld -DNDEBUG
> 
> 
> [1] 
> https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-bisect/176/artifact/artifacts/build-last_good/00-sumfiles/
> [2] 
> https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-bisect/176/artifact/artifacts/build-first_bad/00-sumfiles/
> [3] 
> https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-bisect/176/artifact/artifacts/build-first_bad/00-sumfiles/ninja.log.xz
> 
> Thanks!
> 
> --
> Maxim Kuvyrkov
> https://www.linaro.org
> 
> > On May 24, 2025, at 02:20, Slava Zakharin <szakha...@nvidia.com> wrote:
> > 
> > Hello,
> > 
> > I think there was an error in bisecting these regressions.  I can reproduce 
> > the same failure with commit 6dc6ca3302edadad7d4b195a05038995b84606d0, 
> > which happened before mine.
> > 
> > Thanks,
> > Slava
> > 
> > -----Original Message-----
> > From: ci_not...@linaro.org <ci_not...@linaro.org>
> > Sent: Wednesday, May 21, 2025 9:10 PM
> > To: ohno.yasuy...@fujitsu.com; itou.tets...@fujitsu.com; 
> > t-kawash...@fujitsu.com
> > Cc: Slava Zakharin <szakha...@nvidia.com>; maxim.kuvyr...@linaro.org
> > Subject: [Linaro-TCWG-CI] llvmorg-21-init-11733-g2d12d31f44ac: 3 
> > regressions on aarch64
> > 
> > [You don't often get email from ci_not...@linaro.org. Learn why this is 
> > important at https://aka.ms/LearnAboutSenderIdentification ]
> > 
> > External email: Use caution opening links or attachments
> > 
> > 
> > Dear contributor,
> > 
> > Our automatic CI has detected problems related to your patch(es). Please 
> > find some details below.
> > 
> > In tcwg_flang_test/main-aarch64-Ofast-sve_vls-lto-lld, after:
> >  | commit llvmorg-21-init-11733-g2d12d31f44ac
> >  | Author: Slava Zakharin <szakha...@nvidia.com>
> >  | Date:   Mon May 12 18:33:47 2025 -0700
> >  |
> >  |     [flang] Propagate contiguous attribute through HLFIR. (#138797)
> >  |
> >  |     This change allows marking more designators producing an opaque
> >  |     box with 'contiguous' attribute, e.g. like in test1 case
> >  |     in flang/test/HLFIR/propagate-contiguous-attribute.fir.
> >  | ... 5 lines of the commit log omitted.
> > 
> > Produces 3 regressions:
> >  |
> >  | regressions.sum:
> >  | Running test-suite:Fujitsu/Fortran/0105 ...
> >  | NOEXE: test-suite :: Fujitsu/Fortran/0105/Fujitsu-Fortran-0105_0089.test
> >  | NOEXE: test-suite :: Fujitsu/Fortran/0105/Fujitsu-Fortran-0105_0204.test
> >  | NOEXE: test-suite :: Fujitsu/Fortran/0105/Fujitsu-Fortran-0105_0205.test
> >  | # "NOEXE" means : the test program cannot be compiled
> > 
> > Used configuration :
> >  * Toolchain : cmake -G Ninja  ../llvm/llvm 
> > "-DLLVM_ENABLE_PROJECTS=clang;lld;flang;openmp;clang-tools-extra"    
> > -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=True        
> > -DCMAKE_INSTALL_PREFIX=../llvm-install          
> > "-DLLVM_TARGETS_TO_BUILD=AArch64" -DCLANG_DEFAULT_LINKER=lld
> >  * Testsuite : export 
> > LD_LIBRARY_PATH=$\WORKSPACE/llvm-install/lib/aarch64-unknown-linux-gnu$\{LD_LIBRARY_PATH:+:$\LD_LIBRARY_PATH}
> > cmake -GNinja  -DCMAKE_C_COMPILER="$\WORKSPACE/llvm-install/bin/clang"      
> >    -DCMAKE_CXX_COMPILER="$\WORKSPACE/llvm-install/bin/clang++"     
> > -DCMAKE_Fortran_COMPILER="$\WORKSPACE/llvm-install/bin/flang-new"       
> > -DCMAKE_BUILD_TYPE=Release      -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= 
> > -DCMAKE_Fortran_FLAGS=      -DCMAKE_C_FLAGS_RELEASE="-O3 -ffast-math 
> > -march=armv8.4-a+sve -msve-vector-bits=256 -mllvm 
> > -treat-scalable-fixed-error-as-warning=false -flto -fuse-ld=lld -DNDEBUG"   
> >  -DCMAKE_CXX_FLAGS_RELEASE="-O3 -ffast-math -march=armv8.4-a+sve 
> > -msve-vector-bits=256 -mllvm -treat-scalable-fixed-error-as-warning=false 
> > -flto -fuse-ld=lld -DNDEBUG"  -DCMAKE_Fortran_FLAGS_RELEASE="-O3 
> > -ffast-math -march=armv8.4-a+sve -msve-vector-bits=256 -mllvm 
> > -treat-scalable-fixed-error-as-warning=false -flto -fuse-ld=lld -DNDEBUG"   
> >    -DTEST_SUITE_FORTRAN=ON         -DTEST_SUITE_SUBDIRS=Fujitsu    
> > "$\WORKSPACE/test/test-suite"
> > 
> > We track this bug report under 
> > https://linaro.atlassian.net/browse/LLVM-1686. Please let us know if you 
> > have a fix.
> > 
> > If you have any questions regarding this report, please ask on 
> > linaro-toolchain@lists.linaro.org mailing list.
> > 
> > -----------------8<--------------------------8<--------------------------8<--------------------------
> > 
> > The information below contains the details of the failures, and the ways to 
> > reproduce a debug environment:
> > 
> > You can find the failure logs in *.log.1.xz files in
> > * 
> > https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-build/2038/artifact/artifacts/00-sumfiles/
> > The full lists of regressions and improvements as well as configure and 
> > make commands are in
> > * 
> > https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-build/2038/artifact/artifacts/notify/
> > The list of [ignored] baseline and flaky failures are in
> > * 
> > https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-build/2038/artifact/artifacts/sumfiles/xfails.xfail
> > 
> > Fujitsu testsuite : https://github.com/fujitsu/compiler-test-suite/
> > 
> > Current build   : 
> > https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-build/2038/artifact/artifacts
> > Reference build : 
> > https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vls-lto-lld-build/2036/artifact/artifacts
> > 
> > Instruction to reproduce the build : 
> > https://git-us.linaro.org/toolchain/ci/interesting-commits.git/plain/llvm/sha1/2d12d31f44acac54d7b2858624cb8a1db5a0a8ce/tcwg_flang_test/main-aarch64-Ofast-sve_vls-lto-lld/reproduction_instructions.txt
> > 
> > Full commit : 
> > https://github.com/llvm/llvm-project/commit/2d12d31f44acac54d7b2858624cb8a1db5a0a8ce
_______________________________________________
linaro-toolchain mailing list -- linaro-toolchain@lists.linaro.org
To unsubscribe send an email to linaro-toolchain-le...@lists.linaro.org

Reply via email to