This is an archive of the discontinued LLVM Phabricator instance.

[SingleSource/Vectorizer] Add unit tests for conditional scalar assignment pattern.
Needs ReviewPublic

Authored by michaelmaitland on Feb 27 2023, 12:41 PM.

Details

Summary

Dedicated unit tests for loops which contain a conditional assignment inside
the loop body.

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 12:41 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
michaelmaitland requested review of this revision.Feb 27 2023, 12:41 PM

I think this is missing a cas.reference_output file? It might also be good to use a more descriptive file name.

SingleSource/UnitTests/Vectorizer/csa.cpp
13 ↗(On Diff #500883)

I just landed D143377 which moves some of the helpers to a header. It would be good to use those instead of duplicating them here.

  • Add reference output file.
  • Use more descriptive file name.
  • Move helperes into common header file.

Remove swp files.

Mel-Chen added inline comments.Mar 1 2023, 5:20 AM
SingleSource/UnitTests/Vectorizer/conditional_scalar_assignment.cpp
43

Why Post? How about put the return statement behind the main loop?

DEFINE_SCALAR_AND_VECTOR_FN4(
      int t = -1;,
      for (int i = 0; i < N; i++) {
        if (i < data0[i])
          t = data0[i];
      }
      return t;,
      );

Remove Post from Macro

michaelmaitland marked an inline comment as done.Mar 1 2023, 2:10 PM