[llvm] r179957 - SimplifyCFG: If convert single conditional stores

Shuxin Yang shuxin.llvm at gmail.com
Sat Apr 20 20:19:48 PDT 2013


On 4/20/13 6:36 PM, Arnold Schwaighofer wrote:
> On Apr 20, 2013, at 8:30 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>
>> On 4/20/13 6:04 PM, Arnold Schwaighofer wrote:
>>> On Apr 20, 2013, at 7:54 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>>>
>>>> It tail dup the load, which dosen't necessarily simplify the CFG.
>>>> I'm from CFG simplification perspective.
>>>>
>>> It does not perform select/if conversation of the store - hence my patch.
>> I guess the "it" here refers to the GVN. The GVN actually perform some PRE here. I don't like PRE
>> is taking place in the early stage (actually in my local hack to GVN, I'm actually trying to disable all
>> PRE  in the early invocation of GVN). It only complicate the CFG because it insert some code in
>> empty block (by edge-splitting) during code motion phase
> By "it" I meant the LLVM opt pass pipeline. GVN gets rid of a redundant load. (It sees a store on one side of the if and a store one the other so no need to load again just use a phi of the two store values - no need to split an edge either)

I take back the lame motivating example. I sort of mix what we are 
having and what I'm trying to do.
To avoid unnecessary confusion, I don't like to discuss here.
>
>> Actually, PRE dose not always win here, what if the branch is balanced and the ISA dosen't have
>> instruction for conditional store? We will suffer from branch misprediction here.
>>
>> What I'm talking about here is about the better motivation to get rid of the guarding condition of
>> the store --- blindly strip if off vs with some motivations.
>>
> My motivation are branch mispredictions. This is why we are so bad on hmmer. We (clang) already gets rid of those loads.
How do you know you reduce the misprediction at this moment? The branch 
is not completely removed, and
you don't know the underlying architecture support for conditional move etc.

On the other hand, in theory, without knowing the branching outcome, 
downstream PRE/GVN can remove
the partial redundant store by reverting back to you have done early...



>
>> I'm sorry I were not clear in my previous mails. Seems like I should not write email during week-end:-)
>>
>>
>>> But the loads are already eliminated so I can't use them to motivate my patch - that is all I am saying.
But it is pretty late.
>> I believe you change takes place early than GVN?
> Yes, but the motivation are not the load because we already get rid of them.




More information about the llvm-commits mailing list