https://llvm.org/bugs/show_bug.cgi?id=24341

            Bug ID: 24341
           Summary: Store merging in DAGCombine if first stores are not
                    consecutive
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedb...@nondot.org
          Reporter: tom.aerno...@synopsys.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified

Created attachment 14683
  --> https://llvm.org/bugs/attachment.cgi?id=14683&action=edit
testcase

Store merging does not happen if the first ordered stores of the chain are non
consecutive. If that is the case consecutive stores later in the ordered list
are not merged.

eg The following code:

void fail(unsigned long long* p) {
  unsigned char* q = (unsigned char*)p;
  q[4] = 1;
  q[0] = 1;
  q[5] = 1;
  q[2] = 1;
}

compiles to:
        movb    $1, 4(%rdi)
        movb    $1, (%rdi)
        movb    $1, 5(%rdi)
        movb    $1, 2(%rdi)


If the consecutive stores are first on the ordered list, the stores are merged
correctly.

eg The following code:

void ok(unsigned long long* p)
{
  unsigned char* q = (unsigned char*)p;

  q[4] = 1;
  q[0] = 1;
  q[6] = 1;
  q[1] = 1;
}

Compiles to:
        movb    $1, 4(%rdi)
        movb    $1, 6(%rdi)
        movw    $257, (%rdi)            # imm = 0x101

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to