Skip to content
  • Chris Lattner's avatar
    Teach the code generator that shrd/shld is commutable if it has an immediate. · 29478017
    Chris Lattner authored
    This allows us to generate this:
    
    foo:
            mov %EAX, DWORD PTR [%ESP + 4]
            mov %EDX, DWORD PTR [%ESP + 8]
            shld %EDX, %EDX, 2
            shl %EAX, 2
            ret
    
    instead of this:
    
    foo:
            mov %EAX, DWORD PTR [%ESP + 4]
            mov %ECX, DWORD PTR [%ESP + 8]
            mov %EDX, %EAX
            shrd %EDX, %ECX, 30
            shl %EAX, 2
            ret
    
    Note the magically transmogrifying immediate.
    
    llvm-svn: 19686
    29478017
Loading