This is an archive of the discontinued LLVM Phabricator instance.

[NFC][3/n] Remove enable-new-pm from Inline tests
ClosedPublic

Authored by speryt on Oct 7 2022, 4:16 PM.

Details

Summary

This change is updating remaining Inline tests
by removing -enable-new-pm=0 flag and adjusting CHECKs
where it is required.

Diff Detail

Event Timeline

speryt created this revision.Oct 7 2022, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 4:16 PM
speryt requested review of this revision.Oct 7 2022, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 4:16 PM
speryt added a comment.Oct 7 2022, 4:32 PM

There are still few tests left with which I'm not sure what resolution would be the best. Any comments are highly appreciated.

In the test dead-calls-willreturn.ll in the last function tested (caller_willreturn) all of the calls are present, which looking at the comment is not expected.

; @caller_willreturn is marked as willreturn, so all called functions also must
; return. All calls are dead.
define void @caller_willreturn() ssp {
; CHECK-LABEL: @caller_willreturn(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    ret void
;
entry:
  call void @readnone_may_not_return() willreturn
  call void @readnone_willreturn()
  ret void
}

Output IR

; Function Attrs: ssp
define void @caller_willreturn() #2 {
entry:
  br label %while.body.i

while.body.i:                                     ; preds = %while.body.i, %entry
  br label %while.body.i

readnone_may_not_return.exit:                     ; No predecessors!
  ret void
}

In tests alloca-merge-align.ll and array_merge.ll extra allocas are added. In case of alloca-merge-align.ll alignment of this alloca is also different than the rest - 4 instead of 8.

In tests inline-cold-callee.ll and inline-hot-callee.ll results are flipped. What I mean by that is in test where calls should be inlined those aren't and in calls where they shouldn't they are.

And finally in delete-call.ll two statistics are missing: abstract-call-sites and cgscc-passmgr.

My best guess is that I might have incorrectly used call to inline pass in new PM. What I've been trying for cases where "-inline" flag was used have been "-passes='inline'" and "-passes='cgscc(inline)'". Nothing works as expected.

the new pass manager inliner doesn't do alloca merging, see the comments around the DisableInlinedAllocaMerging in Inliner.cpp. so we can just delete those tests, including alloca-dbgdeclare-merge.ll

inline-{hot,cold}-callee.ll can be deleted, see https://reviews.llvm.org/D33157 where those tests are testing legacy PM-specific code paths

delete-call.ll/dead-calls-willreturn.ll test functionality added in https://reviews.llvm.org/rGeb9acbfb0522f4f69f1a11e47ebeda7f1a61e1df that's not present in the new PM pass. I tried seeing if it had any compile time impact when ported to the new PM pass, it doesn't seem to, so no reason to port it, so we can drop those tests

speryt updated this revision to Diff 466584.Oct 10 2022, 12:29 PM

Removed tests that can be safely removed based on previous comments.

looks like you dropped some earlier changes in the latest patch

speryt updated this revision to Diff 466586.Oct 10 2022, 12:34 PM

Sorry, I didn't realize that update means completely new diff rather than merging with previous changes. This is merge of my 2 previous patches.

aeubanks accepted this revision.Oct 10 2022, 1:37 PM
This revision is now accepted and ready to land.Oct 10 2022, 1:37 PM
This revision was automatically updated to reflect the committed changes.
llvm/test/Transforms/Inline/inline-cold-callee.ll