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.
Paths
| Differential D117995
[ValueTracking] Add support for X*X self-multiplication ClosedPublic Authored by RKSimon on Jan 23 2022, 10:08 AM.
Details Summary 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
Event TimelineThis revision is now accepted and ready to land.Jan 23 2022, 10:24 AM Comment 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) This revision is now accepted and ready to land.Feb 6 2022, 11:21 AM This revision is now accepted and ready to land.Feb 7 2022, 8:37 AM This revision was landed with ongoing or failed builds.Feb 8 2022, 5:34 AM Closed by commit rG146820274820: [ValueTracking] Add support for X*X self-multiplication (authored by RKSimon). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 402348 llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll
llvm/test/Transforms/InstCombine/mul-masked-bits.ll
|