Given a select whose result is an i1, we can eliminate the conditional in the select completely by adding a few arithmetic operations.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
833–840 | Always avoid nesting multiple IR-creating calls. It can lead to an unpredictable "order of evaluation" dependent output that is sensitive to compilers, their versions, and options. | |
mlir/test/Dialect/Standard/canonicalize.mlir | ||
67–69 | An unstable/unknown order isn't desirable. |
Given a select whose result is an i1, we can eliminate the conditional branch completely by adding a few arithmetic operations.
Nit: Could you clarify which conditional branch you are referring to here? Is it the conditional branch in machine instruction for those architectures without a select instruction?
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
816 | Nit: This comment probably needs an update. |
clang-format not found in user’s local PATH; not linting file.