[PATCH] D145220: [X86][InstCombine] Simplify some `pternlog` intrinsics

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 10:05:58 PDT 2023


goldstein.w.n marked an inline comment as done.
goldstein.w.n added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/X86/x86-ternlog.ll:2312
 ; CHECK-LABEL: @vpternlog_d_constv512_imm0(
-; CHECK-NEXT:    [[R:%.*]] = tail call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> <i32 0, i32 6, i32 1, i32 8, i32 1, i32 8, i32 7, i32 9, i32 1, i32 0, i32 8, i32 8, i32 4, i32 7, i32 0, i32 3>, <16 x i32> <i32 2, i32 7, i32 1, i32 6, i32 8, i32 5, i32 0, i32 2, i32 3, i32 5, i32 6, i32 4, i32 9, i32 4, i32 4, i32 5>, <16 x i32> <i32 2, i32 2, i32 0, i32 9, i32 3, i32 1, i32 2, i32 0, i32 8, i32 0, i32 8, i32 5, i32 5, i32 1, i32 4, i32 9>, i32 0)
-; CHECK-NEXT:    ret <16 x i32> [[R]]
+; CHECK-NEXT:    ret <16 x i32> zeroinitializer
 ;
----------------
pengfei wrote:
> goldstein.w.n wrote:
> > pengfei wrote:
> > > The following constant tests are too tedium and hard to review. Can we use a unittest instead?
> > Done, see new file TernlogTest.cpp
> Thanks! Do we still need these constant tests?
> Thanks! Do we still need these constant tests?

I prefer to keep. I was less so trying to test that the values produced a correct than sanity test that we properly get constant folding in codegen.


================
Comment at: llvm/unittests/Transforms/InstCombine/X86/TernlogTest.cpp:187
+  TernTester TT;
+  for (unsigned NTests = 0; NTests < 1; ++NTests) {
+    for (unsigned NElem = 2; NElem < 16; NElem += NElem) {
----------------
pengfei wrote:
> What is loop used for?
Because the tests use random values it may make sense to increase number of rand iterations. I can remove if you think its unnecessary.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145220



More information about the llvm-commits mailing list