[swift-dev] Tips for debugging interactions between optimization passes

Ben Ng me at benng.me
Fri Mar 3 11:58:43 CST 2017


I noticed that adding any semantic attribute to the two Array.append functions causes performance regressions in the Array benchmark. I think that it’s because the delayed inlining is blocking some array optimizations from happening.

What are some tips for debugging this sort of issue? There are a whole bunch of passes, and it’s difficult to figure out how they all interact. Reading the SIL generated after all optimizations have been run is pretty tedious, and I’m hoping that there’s a smarter way to go about this.

Can I get debug output that tells me what optimizations happened, and then diff the two outputs to find out what changed?

I also see a “Pass Pipeline” utility that looks useful, but it’s not obvious to me how to use it.

Thanks,

Ben Ng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170303/97fbed1f/attachment.html>


More information about the swift-dev mailing list