[PATCH] D136015: [InstCombine] Fold series of instructions into mull

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 07:19:50 PDT 2022


Allen added a comment.

In D136015#3879133 <https://reviews.llvm.org/D136015#3879133>, @spatel wrote:

> Please rebase again after 41c42f5b1825 <https://reviews.llvm.org/rG41c42f5b1825d3f5dfd521f4092c9e64706325a8> /  56c6b612aed1 <https://reviews.llvm.org/rG56c6b612aed1b4bf691a2a5ae731c09b18652ba5>. 
> If I did that correctly, we won't see any changes for the final value in each test from this revision, but we'll test this patch directly and get a better coverage for commuted patterns.
> After that, I think this patch will be complete.

Done, thanks very much for your changes. And I don't completely understand why need the use at the beginning of a function? eg:

  define i8 @mul8_low_A0_B2(i8 %in0, i8 %p) {
    %in1 = call i8 @use8(i8 %p) ; thwart complexity-based canonicalization
    %In0Lo = and i8 %in0, 15
    %In0Hi = lshr i8 %in0, 4
    %In1Lo = and i8 %in1, 15
    %In1Hi = lshr i8 %in1, 4
    %m10 = mul i8 %In1Hi, %in0
    %m01 = mul i8 %in1, %In0Hi
    %m00 = mul i8 %In1Lo, %In0Lo
    %addc = add i8 %m01, %m10
    %shl = shl i8 %addc, 4
    %retLo = add i8 %shl, %m00
    ret i8 %retLo
  }




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136015/new/

https://reviews.llvm.org/D136015



More information about the llvm-commits mailing list