[llvm-commits] patch: go crazy, compute bits for an entire add instruction

Jay Foad jay.foad at gmail.com
Thu Jul 21 02:34:14 PDT 2011


> We don't want to put ourselves in a situation where we do an iteration over
> every instruction calling a method that does a walk over all uses. For an
> n-instruction long chain of computation, that would give us O(n^2) time.

It should be possible to fix the O(n^2) behaviour by memo-ising the
results of ComputeMaskedBits.

I don't have a high-level understanding of how all these bits of
analysis and simplification fit together, so I can't really offer any
constructive opinions.

> But perhaps I should revisit that and see if we can't come up with a way to
> calculate the "demanded" bits in an add, based on the known bits on the lhs
> and rhs and the mask of which bits of output are relevant.

Sounds like a fun bit twiddling problem! I've never thought about this
one so I don't have any ideas to offer.

Jay.



More information about the llvm-commits mailing list