Currently we have to duplicate the same checks in isPotentiallyReassociatable and tryReassociate. With simple pattern like add/mul this may be not a big deal. But the situation gets much worse when I try to add support for min/max. Min/Max may be represented by several instructions and can take different forms. In order reduce complexity for upcoming min/max support we need to restructure the code a bit to avoid mentioned code duplication.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
llvm/lib/Transforms/Scalar/NaryReassociate.cpp | ||
---|---|---|
291 | Return after unreachable not needed. |
This revision is now accepted and ready to land.Oct 29 2020, 9:29 PM
ebrevnov added a parent revision: D88287: [NARY-REASSOCIATE] Support reassociation of min/max.Oct 29 2020, 10:45 PM
ebrevnov added a child revision: D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.
ebrevnov removed a child revision: D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.Dec 3 2020, 1:59 AM
ebrevnov edited parent revisions, added: D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions; removed: D88287: [NARY-REASSOCIATE] Support reassociation of min/max.
This revision was landed with ongoing or failed builds.Dec 4 2020, 1:19 AM
Closed by commit rG061cebb46f6c: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable (authored by Evgeniy Brevnov <ybrevnov@azul.com>). · Explain Why
This revision was automatically updated to reflect the committed changes.
clang-format suggested style edits found: