[PATCH] D78397: [mlir][Transforms] Add pass to perform sparse conditional constant propagation
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 18 11:17:54 PDT 2020
rriddle added inline comments.
================
Comment at: mlir/lib/Transforms/SCCP.cpp:455
+ const LatticeValue &operandLattice = latticeValues[(*branchOperands)[i]];
+ LatticeValue &argLattice = latticeValues[arg];
+ updatedLattice |= argLattice.mergeIn(operandLattice);
----------------
bondhugula wrote:
> `argLattice` is actually invariant? Hoist it out of the loop, and use it in the block above where you are marking it overdefined.
It is recomputed in the loop to avoid potential iterator invalidation w.r.t the lattice for the branch operand. Refactored to avoid eagerly constructing the branch operand lattice.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78397/new/
https://reviews.llvm.org/D78397
More information about the llvm-commits
mailing list