[PATCH] D113214: [IR][ShuffleVector] Introduce `isReplicationMask()` matcher

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 09:19:58 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/unittests/IR/InstructionsTest.cpp:1133
+
+TEST(InstructionsTest, ShuffleMaskIsReplicationMask_undef) {
+  for (int ReplicationFactor : seq_inclusive(1, 6)) {
----------------
rupprecht wrote:
> rupprecht wrote:
> > lebedev.ri wrote:
> > > rupprecht wrote:
> > > > These two exhaustive test cases take an extremely long time to test (3+ minutes for each one). Would it make sense to use `#ifdef EXPENSIVE_CHECKS` for these two?
> > > They take 1 and 2 seconds for me.
> > > How long do tests in `ConstantRangeTest.cpp` take for you?
> > Weird. `ConstantRangeTest` takes 23 seconds in total, most test cases being <.5s but a few being ~2 seconds.
> > 
> > ```
> > $ ./unittests/IR/IRTests --gtest_filter='InstructionsTest.ShuffleMask*'
> > Note: Google Test filter = InstructionsTest.ShuffleMask*
> > [==========] Running 4 tests from 1 test suite.
> > [----------] Global test environment set-up.
> > [----------] 4 tests from InstructionsTest
> > [ RUN      ] InstructionsTest.ShuffleMaskQueries
> > [       OK ] InstructionsTest.ShuffleMaskQueries (2 ms)
> > [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask
> > [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask (0 ms)
> > [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask_undef
> > [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask_undef (227553 ms)
> > [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask_Exhaustive_Correctness
> > [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask_Exhaustive_Correctness (203930 ms)
> > [----------] 4 tests from InstructionsTest (431486 ms total)
> > 
> > [----------] Global test environment tear-down
> > [==========] 4 tests from 1 test suite ran. (431486 ms total)
> > [  PASSED  ] 4 tests.
> > ```
> > 
> > I'm running a debug build. I would expect performance to be degraded, but not this much. I'll see if release build makes a difference.
> Yep, a release build is **much** faster:
> 
> ```
> $ ./unittests/IR/IRTests --gtest_filter='InstructionsTest.ShuffleMask*'
> Note: Google Test filter = InstructionsTest.ShuffleMask*
> [==========] Running 4 tests from 1 test suite.
> [----------] Global test environment set-up.
> [----------] 4 tests from InstructionsTest
> [ RUN      ] InstructionsTest.ShuffleMaskQueries
> [       OK ] InstructionsTest.ShuffleMaskQueries (1 ms)
> [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask
> [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask (0 ms)
> [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask_undef
> [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask_undef (4884 ms)
> [ RUN      ] InstructionsTest.ShuffleMaskIsReplicationMask_Exhaustive_Correctness
> [       OK ] InstructionsTest.ShuffleMaskIsReplicationMask_Exhaustive_Correctness (2030 ms)
> [----------] 4 tests from InstructionsTest (6915 ms total)
> 
> [----------] Global test environment tear-down
> [==========] 4 tests from 1 test suite ran. (6915 ms total)
> [  PASSED  ] 4 tests.
> ```
> 
> I wonder what is so horrendously bad about this test case that the optimizer is able to get rid of so much?
> Weird. ConstantRangeTest takes 23 seconds in total, most test cases being <.5s but a few being ~2 seconds.

In debug build, correct?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113214



More information about the llvm-commits mailing list