[LLVMbugs] [Bug 8571] New: Missing store sinking

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 8 23:17:43 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=8571

           Summary: Missing store sinking
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: xinliangli at gmail.com
                CC: llvmbugs at cs.uiuc.edu


// Test case

struct A { 
 int a;
 int b;
};


int foo (struct A *this, int n, int m ) 
{
   int s = 0;


   if (__builtin_expect(m,0))
   {   
     s = this->a;
   }   
   else
   {   
     this->a = m;        // should be sinked
   }   

   if (__builtin_expect (n,1))
   {   
     this->a = n;
   }   

   return s;
}

// -O2 output:



foo:
.Leh_func_begin0:
        pushq   %rbp
.Ltmp0: 
        movq    %rsp, %rbp
.Ltmp1:
        testl   %edx, %edx
        je      .LBB0_2
        movl    (%rdi), %eax
        jmp     .LBB0_3
.LBB0_2: 
        movl    %edx, (%rdi)         #  Partially dead store not sinked
        xorl    %eax, %eax
.LBB0_3:
        testl   %esi, %esi
        je      .LBB0_5
        movl    %esi, (%rdi)
.LBB0_5:
        popq    %rbp
        ret




David

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list