[PATCH] D31302: [CodeGen] Compute DT/LI lazily in SafeStackLegacyPass. NFC.

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 19:27:36 PDT 2017


ab added a subscriber: mzolotukhin.
ab added a comment.

Of course, sorry, here's some context: Michael and I noticed 4 unnecessary DT computations at O0.  Altogether, they added up to a non-trivial compile-time win on the CTMark subset of the test-suite: 1.3-4.7%, 2.5% geomean.

This removes one of the 4 DT uses.  Here are patches for the other two: https://reviews.llvm.org/D31641, https://reviews.llvm.org/D31642.

I think this is awkward, but it seems like a reasonably self-contained stopgap until we have cached lazy analyzes.  (the least bad alternative I came up with was to add a TargetOption for safestack, and disable it from clang if we weren't passed -fsanitize=safestack.  But that has a bunch of edge cases we might as well avoid, for llc, LTO, and clang on IR inputs).

To be clear, I don't think this is acceptable if it becomes pervasive:  it seems like these backend passes are exceptions in that they're part of the O0 pipeline, only run at a fixed location in the pipeline, and are known to follow other pre-isel passes that don't preserve anything.  More importantly, we have a cleaner path forward with the new pass manager.


https://reviews.llvm.org/D31302





More information about the llvm-commits mailing list