[patch] simplifyCFG for review

Chandler Carruth chandlerc at google.com
Sat Jul 27 00:08:48 PDT 2013


On Fri, Jul 26, 2013 at 11:18 PM, Chandler Carruth <chandlerc at google.com>wrote:

> #3 is *definitely* wrong. Please revert that part immediately.


OK, I've investigated this more closely, and it turns out to be benign on
any target but R600, so *when* it comes out doesn't really matter, but it
definitely isn't right.

When I investigated it, I found this part of the entire patch really
strange. We have had for some time the questionable decision of passing
TargetTransformInfo down into SimplifyCFG and using it. One might think
that 'IsTargetAware' controls this decision. But it doesn't. Instead, it
controls whether we pass a non-null AliasAnalysis to SimplifyCFG, despite
the fact that AA is a totally target independent thing and would be
reasonable in the canonicalizing form of SimplifyCFG. This interface speaks
to problem #2 I mentioned in my prior email.

Now, as it happens, the only thing that uses AA in SimplifyCFG is the newly
added logic such that this has the intended effect, but I don't think this
mechanism makes much sense.

Making TTI not be used in the canonicalizing phase is part of the larger
refactoring of the midlevel optimizer that Andy's email aluded to and that
I think is really important to happen before we start adding lots of
target-specific logic to passes that share logic between the phases. We
need to get interfaces for those *right*. However, I think a specialized
pass that is added late in the pipeline by the target continues to be a
reasonable compromise to allow forward progress until that refactoring
happens.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130727/b790f15e/attachment.html>


More information about the llvm-commits mailing list