[PATCH] D24955: [ValueTracking] Teach computeKnownBits and ComputeNumSignBits to look through ExtractElement.

Bjorn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 01:40:19 PDT 2016


bjope added a comment.

In https://reviews.llvm.org/D24955#554091, @spatel wrote:

> The idea looks good to me, but we should increase the depth for the recursive call. The reason that depth is not incremented for the ExtractValue case is that computeKnownBitsAddSub / computeKnownBitsMul are helper functions (they are not recursing on themselves), so the depth is incremented internally when calling computeKnownBits.


Ok, well, if Depth is about level of recursion then I agree. If it is about "search depth", then I got the feeling that it was about how many "operational" instructions that could be analysed. In the case of ExtractValue it increases Depth by one, when analysing both the ExtractValue and the add/sub/mul operation. So from an LLVM IR perspective it traverses two instructions on the same Depth, and ExtractValue does not count towards Depth.

Anyhow, I'll make sure we increase the Depth when looking through ExtractElement.

BTW, highly appreciate your comments about the testcases. It will be much easier to use -instsimplify for these tests.


https://reviews.llvm.org/D24955





More information about the llvm-commits mailing list