D108992 added KnownBits handling for 'Quadratic Reciprocity' self-multiplication patterns (bit[1] == 0).
This patch adds selfmultiply handling to value tracking so demanded bits patterns can make use of it.
Differential D117995
[ValueTracking] Add support for X*X self-multiplication RKSimon on Jan 23 2022, 10:08 AM. Authored by
Details D108992 added KnownBits handling for 'Quadratic Reciprocity' self-multiplication patterns (bit[1] == 0). This patch adds selfmultiply handling to value tracking so demanded bits patterns can make use of it.
Diff Detail
Unit Tests Event TimelineComment Actions alive2 says the following is invalid: define i5 @src(i5 %x) { %a = mul i5 %x, %x %b = and i5 %a, -3 ret i5 %b } define i5 @tgt(i5 %x) { %a = mul i5 %x, %x ret i5 %a } Transformation doesn't verify! ERROR: Value mismatch Example: i5 %x = undef Source: i5 %a = any i5 %b = #x00 (0) [based on undef value] Target: i5 %a = #x02 (2) Source value: #x00 (0) Target value: #x02 (2) |