[PATCH] D34029: Infer lowest bits of an integer Multiply when the low bits of the operands are known

Pedro Ferreira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 04:29:02 PDT 2017


PFerreira added a comment.

I have been fiddling with Alive, but it has been crashing on me (even on simple proofs). I guessed this was a temporary issue, but after 2 weeks it is still not working with "Oops, it seems that this tool encountered an issue."
The last version of the expression I got was

Name: mul_to_const
Pre: C1 >= 0 && C1 < 32 && C2 >= 0 && C2 < 64 && CLZ1 == countTrailingZeros(C1) && CLZ2 == countTrailingZeros(C2) && C3==((1 << (6+CLZ1+CLZ2))-1)
%aa = shl i32 %a, 5
%bb = shl i32 %b, 6
%aaa = or i32 %aa, C1
%bbb = or i32 %bb, C2
%aaaa = lshr i32 %aaa, CLZ1
%bbbb = lshr i32 %bbb, CLZ2
%mul = mul i32 %aaaa, %bbbb
%adjust = add i32 C1, C2
%result = shl %mul, %adjust
%mask = and i32 %result, C3

  =>

%mask = i32 ((C1*C2)&C3)


https://reviews.llvm.org/D34029





More information about the llvm-commits mailing list