From c6cf16994097d5c8759968940589cdc1b6bbd591 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 11 Aug 2018 06:42:50 +0000 Subject: [PATCH] [X86] Add the mem-reg form of CMP to the macro fusion shouldScheduleAdjacent. Unlike the other arithmetic instructions the mem-reg form of compare is just a load and not a RMW operation. According to the Intel optimization manual, this form is also supported by macro fusion. llvm-svn: 339498 --- llvm/lib/Target/X86/X86MacroFusion.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/Target/X86/X86MacroFusion.cpp b/llvm/lib/Target/X86/X86MacroFusion.cpp index 15e4b57..29db1c6 100644 --- a/llvm/lib/Target/X86/X86MacroFusion.cpp +++ b/llvm/lib/Target/X86/X86MacroFusion.cpp @@ -111,20 +111,24 @@ static bool shouldScheduleAdjacent(const TargetInstrInfo &TII, case X86::CMP16ri8: case X86::CMP16rm: case X86::CMP16rr: + case X86::CMP16mr: case X86::CMP32i32: case X86::CMP32ri: case X86::CMP32ri8: case X86::CMP32rm: case X86::CMP32rr: + case X86::CMP32mr: case X86::CMP64i32: case X86::CMP64ri32: case X86::CMP64ri8: case X86::CMP64rm: case X86::CMP64rr: + case X86::CMP64mr: case X86::CMP8i8: case X86::CMP8ri: case X86::CMP8rm: case X86::CMP8rr: + case X86::CMP8mr: case X86::ADD16i16: case X86::ADD16ri: case X86::ADD16ri8: -- 2.7.4