[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


           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;
     this->a = m;        // should be sinked

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

   return s;

// -O2 output:

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


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