This is an archive of the discontinued LLVM Phabricator instance.

[NewPM][GuardWidening] Fix loop guard widening tests under NPM
ClosedPublic

Authored by aeubanks on Aug 5 2020, 9:15 PM.

Diff Detail

Event Timeline

aeubanks created this revision.Aug 5 2020, 9:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 9:15 PM
aeubanks requested review of this revision.Aug 5 2020, 9:15 PM
ychen accepted this revision.Aug 5 2020, 9:23 PM

LGTM

This revision is now accepted and ready to land.Aug 5 2020, 9:23 PM
bjope added a subscriber: bjope.Aug 6 2020, 12:33 AM
bjope added inline comments.
llvm/test/Transforms/GuardWidening/loop-schedule.ll
7–14

Why isn't this checked for NewPM?
If this is the main point with the test, then the main point verification is missing with NewPM!?!?

Btw, shouldn't it be CHECK-NEXT if one wants to verify that there is nothing between those checked lines.

aeubanks updated this revision to Diff 283663.Aug 6 2020, 10:49 AM

One more missed test

asbirlea added inline comments.Aug 6 2020, 10:50 AM
llvm/test/Transforms/GuardWidening/loop-schedule.ll
2

For NPM use -debug-pass-manager. The flag -debug-pass=Structure is a no-op.
Add --check-prefixes=NPM,CHECK.
Check lines with NPM prefix:

Starting Loop pass manager run.
Running pass: LICMPass on Loop at depth 1 containing: %loop<header><latch><exiting>
Running pass: GuardWideningPass on Loop at depth 1 containing: %loop<header><latch><exiting>
Running pass: LICMPass on Loop at depth 1 containing: %loop<header><latch><exiting>
Finished Loop pass manager run.
aeubanks updated this revision to Diff 283664.Aug 6 2020, 10:53 AM

Also test under NPM

aeubanks added inline comments.Aug 6 2020, 10:55 AM
llvm/test/Transforms/GuardWidening/loop-schedule.ll
7–14

I also was wondering why it wasn't CHECK-NEXT.

Here's the relevant output:

Loop Pass Manager
  Loop Invariant Code Motion
Loop Pass Manager
  Widen guards (within a single loop, as a loop pass)
Memory SSA
Loop Pass Manager
  Loop Invariant Code Motion

The "Memory SSA" looks like what the test is hoping doesn't exist, maybe that's why it isn't CHECK-NEXT. You can try and fix this test up if you want.

The NPM version does work as intended though, added that.

ychen added a comment.Aug 6 2020, 10:57 AM

Not sure we need to be so complete here. 9258e9d190af643ed5d770fa8a965af3b7090502 introduce this test for legacy PM only. There are separate tests for NPM.

Harbormaster completed remote builds in B67349: Diff 283663.
asbirlea added inline comments.Aug 6 2020, 1:05 PM
llvm/test/Transforms/GuardWidening/loop-schedule.ll
7–14

This seems to be due to the widen guards pass not marking MemorySSA as preserved. This seems worth fixing in GuardWidening to explicitly mark it preserved for all types of passes.

asbirlea accepted this revision.Aug 6 2020, 1:06 PM
This revision was landed with ongoing or failed builds.Aug 6 2020, 3:33 PM
This revision was automatically updated to reflect the committed changes.