[ValueTracking] peek through extends in haveNoCommonBitsSet
authorSanjay Patel <spatel@rotateright.com>
Tue, 13 Dec 2022 20:16:47 +0000 (15:16 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 13 Dec 2022 20:53:20 +0000 (15:53 -0500)
commit7520d187cf0dedcf5085f71bc1a5472c75cc8dbb
tree4a69ba2eeb14290eeb74eeced3ec60df99b1a7c4
parentc8cba0bc4a8c9f4f3f10e17f601ed924dfb82bef
[ValueTracking] peek through extends in haveNoCommonBitsSet

In cases with matching extends, this allows changing an 'add'
into an 'or' and narrowing the 'or' which then simplifies to
a constant.

In cases with opposite extends, we just convert to an 'or'
currently, but that could be reduced too.

https://alive2.llvm.org/ce/z/fTHzdb
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/add.ll