<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - use imul instead of lea to implement multiplication when the argument is call-by-reference"
   href="http://llvm.org/bugs/show_bug.cgi?id=19047">19047</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>use imul instead of lea to implement multiplication when the argument is call-by-reference
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cfy1990@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$  clang++ --version             
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
$ cat test.cc                      
void foo(int &a,int &b){
    b = a * 5;//imull    $5, (%rdi), %eax
}
int foo(int a){
    return a *5; //leal    (%rdi,%rdi,4), %eax
}
$ clang++ -Ofast test.cc -c -S -o -
    .section    __TEXT,__text,regular,pure_instructions
    .globl    __Z3fooRiS_
    .align    4, 0x90
__Z3fooRiS_:                            ## @_Z3fooRiS_
    .cfi_startproc
## BB#0:
    pushq    %rbp
Ltmp2:
    .cfi_def_cfa_offset 16
Ltmp3:
    .cfi_offset %rbp, -16
    movq    %rsp, %rbp
Ltmp4:
    .cfi_def_cfa_register %rbp
    imull    $5, (%rdi), %eax
    movl    %eax, (%rsi)
    popq    %rbp
    ret
    .cfi_endproc

    .globl    __Z3fooi
    .align    4, 0x90
__Z3fooi:                               ## @_Z3fooi
    .cfi_startproc
## BB#0:
    pushq    %rbp
Ltmp7:
    .cfi_def_cfa_offset 16
Ltmp8:
    .cfi_offset %rbp, -16
    movq    %rsp, %rbp
Ltmp9:
    .cfi_def_cfa_register %rbp
    leal    (%rdi,%rdi,4), %eax
    popq    %rbp
    ret
    .cfi_endproc


.subsections_via_symbols</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>