diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-19 07:11:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-19 07:11:01 +0000 |
commit | 41e431ba045eb317ebf0ec45b563a5d96c212f5c (patch) | |
tree | 4269a38badc0912d3398aa99fb717578c4316df4 /lib/Target/X86/X86InstrInfo.h | |
parent | c71d6949b91e19610f0f85f57b402b4df43019a5 (diff) | |
download | external_llvm-41e431ba045eb317ebf0ec45b563a5d96c212f5c.zip external_llvm-41e431ba045eb317ebf0ec45b563a5d96c212f5c.tar.gz external_llvm-41e431ba045eb317ebf0ec45b563a5d96c212f5c.tar.bz2 |
Teach the code generator that shrd/shld is commutable if it has an immediate.
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.h')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index c8f8716..f185569 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -191,6 +191,12 @@ public: /// virtual MachineInstr *convertToThreeAddress(MachineInstr *TA) const; + /// commuteInstruction - We have a few instructions that must be hacked on to + /// commute them. + /// + virtual MachineInstr *commuteInstruction(MachineInstr *MI) const; + + /// Insert a goto (unconditional branch) sequence to TMBB, at the /// end of MBB virtual void insertGoto(MachineBasicBlock& MBB, |