This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen][TargetPassConfig] Add TargetTransformInfo pass correctly
ClosedPublic

Authored by evgeny777 on Jul 17 2020, 9:51 AM.

Details

Summary

When -start-after or -start-before is given tti pass is added with default TargetTransformInfo and LSR (probably other passes also) fails to make some optimizations. This also makes it impossible to properly analyze codegen pipeline, because in the example below foo.s and bar.s will almost always be different:

llc -O3 foo.ll -o foo.s
llc -O3 -stop-after=<pass> foo.ll -o foo.mir
llc -O3 -start-after=<pass> foo.mir -o bar.s

Diff Detail

Event Timeline

evgeny777 created this revision.Jul 17 2020, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2020, 9:51 AM
Herald added subscribers: jfb, hiraditya. · View Herald Transcript
ychen accepted this revision.Jul 17 2020, 10:10 AM
ychen added a subscriber: ychen.

I also hit this recently. LGTM.

This revision is now accepted and ready to land.Jul 17 2020, 10:10 AM
This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.Jul 18 2020, 11:19 AM
llvm/lib/CodeGen/TargetPassConfig.cpp
882

Thanks! In the case of -start-after, this line was a no-op..

How did you notice the problem?

How did you notice the problem?

I have to study compiler regressions every now and then and use -start-after / -run-pass to inspect / modify intermediate pipeline states.