Some of the SPEC tests end up with reduction+(sext/zext(<n x i1>) to <n x im>) pattern, which can be transformed to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im.
https://alive2.llvm.org/ce/z/TBZbdZ
https://alive2.llvm.org/ce/z/N6qJGz
Paths
| Differential D105587
[Instcombine]Transform reduction+(sext/zext(<n x i1>) to <n x im>) to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im. ClosedPublic Authored by ABataev on Jul 7 2021, 1:16 PM.
Details Summary Some of the SPEC tests end up with reduction+(sext/zext(<n x i1>) to <n x im>) pattern, which can be transformed to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im. https://alive2.llvm.org/ce/z/TBZbdZ
Diff Detail
Event TimelineComment Actions
Yes, checked it via alive2 before uploading Comment Actions
While not required, since you already had it, it is really good to make patch description more useful by adding such details there.
Comment Actions
Sure.
lebedev.ri added inline comments. This revision is now accepted and ready to land.Jul 8 2021, 7:24 AM This revision was landed with ongoing or failed builds.Jul 8 2021, 7:57 AM Closed by commit rGb5113bff461b: [Instcombine]Transform reduction+(sext/zext(<n x i1>) to <n x im>) to… (authored by ABataev). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 357225 llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/reduction-add-sext-zext-i1.ll
|
Extension is optional: https://alive2.llvm.org/ce/z/N6qJGz
Please either use m_ZExtOrSExtOrSelf(), or if it's already handled elsewhere add a comment about that.