[SLP]Fix PR55688: Miscompile due to incorrect nuw/nsw handling.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 25 May 2022 11:37:51 +0000 (04:37 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Wed, 25 May 2022 20:59:06 +0000 (13:59 -0700)
commit10f41a214767219ef369b217f685eb545b80e386
treebd6eabdceba04f74bce754e88593a93366e57f48
parent5520c5839016d1d98d8e01789eb17c910381bd6f
[SLP]Fix PR55688: Miscompile due to incorrect nuw/nsw handling.

Need to use all ReductionOps when propagating flags for the reduction
ops, otherwise transformation is not correct. Plus, need to drop nuw/nsw
flags.

Differential Revision: https://reviews.llvm.org/D126371
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll
llvm/test/Transforms/SLPVectorizer/X86/horizontal-list.ll
llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
llvm/test/Transforms/SLPVectorizer/X86/remark_horcost.ll
llvm/test/Transforms/SLPVectorizer/X86/scheduling.ll