RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2025710 - Test fails on s390x: test/Transforms/SLPVectorizer/slp-max-phi-size.ll
Summary: Test fails on s390x: test/Transforms/SLPVectorizer/slp-max-phi-size.ll
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: llvm
Version: 8.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: serge_sans_paille
QA Contact: Miloš Prchlík
URL:
Whiteboard:
Depends On: 2028609
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-22 19:31 UTC by Tom Stellard
Modified: 2022-05-10 14:24 UTC (History)
3 users (show)

Fixed In Version: llvm-13.0.1-1.module+el8.6.0+14118+d530a951
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:52:26 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Reduced test case (1.62 KB, text/plain)
2021-11-22 19:31 UTC, Tom Stellard
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-103598 0 None None None 2021-11-22 19:32:13 UTC
Red Hat Product Errata RHBA-2022:1856 0 None None None 2022-05-10 13:52:50 UTC

Description Tom Stellard 2021-11-22 19:31:02 UTC
Created attachment 1843059 [details]
Reduced test case

The test test/Transforms/SLPVectorizer/slp-max-phi-size.ll fails on s390x.  slp-max-phi-size.ll doesn't crash, it just produces the wrong output, but I've attached a reduced test case that does crash.  My guess it is the same problem causing both failures .ll files.

My best guess is that the storage member of the SmallDenseMap class is being used uninitialized, I've seen different versions of gcc warn about uninitialized usage of this variable.

Comment 3 serge_sans_paille 2021-11-26 16:16:12 UTC
As a short term workaround: changing the type of `Incoming` to `std::vector` instead of `SmallVector` fixes the issue, which seems to be a gcc miscompilation (or a bug in LLVM Codebase).
Switching for -O2 to -O1 for SLPVectorizerPass::vectorizeChainsInBlock also fixes the issue.
 
I'll try to compile with a later GCC version to check if it changes something.

Comment 4 serge_sans_paille 2021-12-01 10:25:30 UTC
Some more inputs.

I've been recompiling SLPVectorizer.cpp with different version of GCC trying to understand which version generates segfaulting code and which version doesn't. I've also tried to use `#pragma GCC optimize("O2")` on a smaller block and compile the remaining part in `-O1` in order to reduce the scope.

failing gcc version: 635aeaa20ffdf6e794f180cc8e053e8dc46db760
next version (working): ef976be1a23a5171082cf1a569d00573013a175c

When recompiling gcc I used:

../configure --enable-languages=c,c++ --prefix=$PWD/../install --disable-bootstrap --disable-sjlj-exceptions --disable-multilib --disable-libsanitizer --with-long-double-128 --with-arch=z13 --with-tune=z14 && make -j3 && make install

Then the SLPVectorizer.cpp got compiled with:

/root/gcc/install/bin/g++  -save-temps -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Transforms/Vectorize -I/root/llvm-project/llvm/lib/Transforms/Vectorize -Iinclude -I/root/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O1 -g -DNDEBUG -fPIC  -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/Transforms/Vectorize/CMakeFiles/LLVMVectorize.dir/SLPVectorizer.cpp.o -MF lib/Transforms/Vectorize/CMakeFiles/LLVMVectorize.dir/SLPVectorizer.cpp.o.d -o lib/Transforms/Vectorize/CMakeFiles/LLVMVectorize.dir/SLPVectorizer.cpp.o -c /root/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

I saved the temporaries as SLPVectorizer.works.ii, SLPVectorizer.works.s, SLPVectorizer.fails.ii  and SLPVectorizer.fails.s, attached to this bug.

Comment 7 serge_sans_paille 2021-12-01 10:37:50 UTC
Extra information: the error is spotted by valgrind as an uninitialized value:

=1584621== Conditional jump or move depends on uninitialised value(s)                                                                                                                                            
==1584621==    at 0x5CD5574: isEqual (DenseMapInfo.h:235)                                                                                                                                                         
==1584621==    by 0x5CD5574: LookupBucketFor<std::pair<llvm::AnalysisKey*, llvm::Function*> > (DenseMap.h:631)                                                                                                     
==1584621==    by 0x5CD5574: find (DenseMap.h:161)                                                                                                                                                                
==1584621==    by 0x5CD5574: getCachedResultImpl (PassManager.h:890)                                                                                                                                              
==1584621==    by 0x5CD5574: getCachedResult<llvm::TargetLibraryAnalysis> (PassManager.h:806)                                                                                                                      
==1584621==    by 0x5CD5574: llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (SLPVectorizer.cpp:7606)                                                                       
==1584621==    by 0x4A5F801: llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Fun
ction>&) (PassManagerInternal.h:88)
==1584621==    by 0x67CD547: llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (PassManager.h:525)
==1584621==    by 0x4A5B5E1: llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run
(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (PassManagerInternal.h:88)
==1584621==    by 0x67CBDC9: llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (PassManager.cpp:128)
==1584621==    by 0x1023279: llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm:
:Module>&) (PassManagerInternal.h:88)                                                                                                                                                                             
==1584621==    by 0x67C8BB1: llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (PassManager.h:525)                                    
==1584621==    by 0x102D949: llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::S
tringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) (NewPMDriver.cpp:487)                                                          
==1584621==    by 0x101E7E3: main (opt.cpp:818)

Semantically, I checked that the bucket lookup is in bound.

Comment 25 Miloš Prchlík 2022-02-17 09:11:23 UTC
Verified with llvm-toolset:rhel8:8060020220204053142:d63f516d.

Comment 27 errata-xmlrpc 2022-05-10 13:52:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (llvm-toolset:rhel8 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1856


Note You need to log in before you can comment on or make changes to this bug.