[PATCH] D36504: [CodeGenPrepare] Convert uncond. branch to return into a return to help with shrink-wrapping

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 22:34:27 PDT 2017

nemanjai added a comment.

As one might expect, this causes a fair number of lit test cases to fail (65 to be more precise). Rather than sinking a whole bunch of time initially on updating them and producing a very large patch, I wanted to get a sense of whether the reviewers are interested in proceeding with this patch first.

So if we do want this (and we do want it to trigger for all targets), I'll update the test cases upon hearing so.

Comment at: lib/CodeGen/CodeGenPrepare.cpp:332
+  // Before we eliminate empty blocks, try to see if some of them can be
+  // converted to return blocks if the target wants that.
+  EverMadeChange |= tryEarlyReturns(F);
I initially meant to add a target hook to see if this is desired by the target, but decided against it as I don't see an issue with always doing so. Depending on the review comments, I can either remove this comment or re-add the target hook.



More information about the llvm-commits mailing list