[PATCH] R600/SI: Use isProfitableToDupForIfCvt

Christian König deathsimple at vodafone.de
Tue Mar 18 11:40:40 PDT 2014


Am 18.03.2014 19:23, schrieb Matt Arsenault:
> On Mar 18, 2014, at 11:09 AM, Tom Stellard <tom at stellard.net> wrote:
>
>> On Tue, Mar 18, 2014 at 10:21:56AM -0700, Matt Arsenault wrote:
>>> On 03/18/2014 10:12 AM, Tom Stellard wrote:
>>>> Are these used outside of the IfConversion pass?  Because we don't use
>>>> IfConversion on SI.
>>> No. I assume that's because of the control flow intrinsics? I was
>>> planning on trying something that would eventually remove them.
>>>
>> The main reason we don't run it on SI is that no one has implemented all
>> the required callbacks for predicating instructions or even the
>> Insert, Remove, and Analyze Branch functions.
>>
>> I'm not sure whether or not the control flow intrinsics make it hard
>> or impossible to implement these, but I am interested to hear your idea
>> for removing them.
> I’ve started to think doing the structurization at the IR level is not the optimal way to do it.

That's true, but at that time it was the simpler solution.

> I am planning on implementing the algorithm in a recent research paper for how to handle unstructured control flow. Instead of duplicating blocks, it inserts guard variables which keep track of what the predcessor block was. It’s best done much later, and I was going to try implementing it with AnalyzeBranch and co.

That actually sounds like the algorithm we currently already use in the 
structurizer. The last time I looked at it it actually never duplicated 
any blocks.

The only crux with it is that you need more than AnalyzeBranch and co. 
Especially logical operators like "and", "or", "not" and "xor" are 
needed as well and might not fold so well if used at the instruction level.

Christian.

>   That’s what the paper recommends, and I tried to see if it could be used on IR, but as expected trying to use it on SSA form was pretty awful. At that point the intrinsics are just obstacles.
>
> -Matt
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list