[all-commits] [llvm/llvm-project] 952e71: [NFC][InstCombine] Negator: tests for extracteleme...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Wed May 20 11:48:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 952e7106b34097ba447326a58e51778af25f070f
      https://github.com/llvm/llvm-project/commit/952e7106b34097ba447326a58e51778af25f070f
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-05-20 (Wed, 20 May 2020)

  Changed paths:
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [NFC][InstCombine] Negator: tests for extractelement negation


  Commit: ebed96fdbf26c081ecbff990fc7f5ae35e9ad2c7
      https://github.com/llvm/llvm-project/commit/ebed96fdbf26c081ecbff990fc7f5ae35e9ad2c7
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-05-20 (Wed, 20 May 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [InstCombine] Negator: `extractelement` is negatible if src is negatible

----------------------------------------
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1 = extractelement <2 x i4> %t0, i32 %y
  %t2 = sub i4 %z, %t1
  ret i4 %t2
}
=>
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1.neg = extractelement <2 x i4> %x, i32 %y
  %t2 = add i4 %t1.neg, %z
  ret i4 %t2
}
Transformation seems to be correct!


  Commit: a6097cebe9cd0887478cb81f9b09f1c48ae13b4f
      https://github.com/llvm/llvm-project/commit/a6097cebe9cd0887478cb81f9b09f1c48ae13b4f
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-05-20 (Wed, 20 May 2020)

  Changed paths:
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [NFC][InstCombine] Negator: tests for insertelement negation


  Commit: 55430f53f397e942b91d8379b5dbae5d2c852986
      https://github.com/llvm/llvm-project/commit/55430f53f397e942b91d8379b5dbae5d2c852986
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-05-20 (Wed, 20 May 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [InstCombine] `insertelement` is negatible if both sources are negatible

----------------------------------------
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %src
  %t1 = sub i4 0, %a
  %t2 = insertelement <2 x i4> %t0, i4 %t1, i32 %x
  %t3 = sub <2 x i4> %b, %t2
  ret <2 x i4> %t3
}
=>
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t2.neg = insertelement <2 x i4> %src, i4 %a, i32 %x
  %t3 = add <2 x i4> %t2.neg, %b
  ret <2 x i4> %t3
}
Transformation seems to be correct!


Compare: https://github.com/llvm/llvm-project/compare/9f19cc8cac89...55430f53f397


More information about the All-commits mailing list