Need gto use all ReductionOps when propagating flags for the reduction
ops, otherwise transformation is not correct.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not sure how this patch works on the given example, but I don't think it is sufficient.
We probably need to do what was suggested in the bug report - do not propagate flags when creating reduction ops.
We should add minimal tests that exercise these paths. For example, I don't think the patch works on this test:
https://alive2.llvm.org/ce/z/oZ703c
I don't know if this exercises any different paths, but I added the test that I suggested here:
d3187dd5f0f0
...because other regression tests in these files are not reduced enough to easily verify with Alive2.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
10329–10330 | Adjust this description. | |
10350–10351 | Can this one also cause trouble? |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
10350–10351 | Removed it, not used anymore. |
Change patch title before committing to mention 'nsw'
I'm not sure if we can actually expose a bug with 'nuw':
https://alive2.llvm.org/ce/z/bRVPr_
...but we can restore that if it matters.
LGTM
Adjust this description.