diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-08-15 17:01:54 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-08-15 17:01:54 +0000 |
commit | 40d4eb40f683447f226eadeddcd37919e78039a4 (patch) | |
tree | e7071e6772ffb2772e3cfc516f354201a1de1fb0 /llvm/lib | |
parent | d65ace84c7314b04ab462cd133c0982dafcdea58 (diff) | |
download | bcm5719-llvm-40d4eb40f683447f226eadeddcd37919e78039a4.tar.gz bcm5719-llvm-40d4eb40f683447f226eadeddcd37919e78039a4.zip |
[x86] enable machine combiner reassociations for scalar single-precision minimums
llvm-svn: 245166
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index c2ff9109b3a..bd3a3e5165d 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -6385,11 +6385,17 @@ static bool hasReassociableSibling(const MachineInstr &Inst, bool &Commuted) { // TODO: There are many more machine instruction opcodes to match: // 1. Other data types (integer, vectors) // 2. Other math / logic operations (and, or) +// 3. Other forms of the same operation (intrinsics and other variants) static bool isAssociativeAndCommutative(const MachineInstr &Inst) { switch (Inst.getOpcode()) { case X86::IMUL16rr: case X86::IMUL32rr: case X86::IMUL64rr: + // Normal min/max instructions are not commutative because of NaN and signed + // zero semantics, but these are. Thus, there's no need to check for global + // relaxed math; the instructions themselves have the properties we need. + case X86::MINCSSrr: + case X86::VMINCSSrr: return true; case X86::ADDPDrr: case X86::ADDPSrr: |