[LLVMdev] Dead Store Elimination
    Vinayak Borkar 
    vborky at yahoo.com
       
    Mon Sep 10 13:26:17 PDT 2012
    
    
  
Hi Duncan,
The mem2reg pass did not help. Moving the alloca instructions into the 
entry block did the trick.
One other thing I noticed is that if there was only one alloca, the dead 
store is eliminated. Having the second one (does not matter which of the 
two) prevents the elimination. Is this a bug?
Thanks,
Vinayak
On 9/10/12 8:16 AM, Duncan Sands wrote:
> Hi Vinayak,
>
>> Here is the result of optimization using the following passes:
>>
>> llvm::createBasicAliasAnalysisPass()
>> llvm::createInstructionCombiningPass()
>> llvm::createReassociatePass()
>> llvm::createGVNPass()
>> llvm::createCFGSimplificationPass()
>>
>
> you should run the mem2reg pass too, and first.
>
>> ; <label>:7                                       ; preds =
>> %openSuccessBB
>>    %8 = alloca i64, align 8
>
> Put alloca instructions in the entry block if possible.
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
    
    
More information about the llvm-dev
mailing list