The current logic is pretty limitted unless the Op is a
constant. This at least covers more obvious cases.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
5020 | I think you want Depth -1 here to counteract the increment earlier. The switch in computeKnownBits should be the same depth as the switch in this function. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
5020 | return computeKnownBits(Op, Depth - 1).isNonZero(). KnownBits already has a wrapper so we don't have to reference the One field directly. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
5020 | It would be less confusing overall to *not* increment Depth. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
5020 | I think in this case is but it makes it so that in all the recursive cases you can just copy Depth rather than Depth + 1. Its also what we do in ValueTracking to think it makes sense to keep it similiar. |
I think you want Depth -1 here to counteract the increment earlier. The switch in computeKnownBits should be the same depth as the switch in this function.