[llvm] [Analysis] Improve readability of `KnownBits::pext` and `KnownBits::pdep` (PR #205176)

Jan Schultke via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 12:48:50 PDT 2026


eisenwave wrote:

This deals with some leftover comments here https://github.com/llvm/llvm-project/pull/204223#discussion_r3452677752

I also realized that the quality of the code comments in `pext` and `pdep` is really not that great. I found myself pretty confused for 15 minutes when actually trying to understand the approach from the comments, in part because they're not consistent about using the parameter and variable names in the function, and they're kinda dogwater in general.

One may argue that we don't need so many comments, but the approach of `pext` and `pdep` is so counter-intuitive and logically negated all over the place, that you really can't understand this easily without those comments.

CC @jayfoad @RKSimon 

https://github.com/llvm/llvm-project/pull/205176


More information about the llvm-commits mailing list