From: Craig Topper Date: Fri, 12 Jul 2019 17:52:17 +0000 (+0000) Subject: [X86] Add NEG to isUseDefConvertible. X-Git-Tag: llvmorg-10-init~477 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98f931639bfcde822d6b680a77c91baebe3cfcf4;p=platform%2Fupstream%2Fllvm.git [X86] Add NEG to isUseDefConvertible. We can use the C flag from NEG to detect that the input was zero. Really we could probably use the Z flag too. But C matches what we'd do for usubo 0, X. Haven't found a test case for this due to the usubo formation in CGP. But I verified if I comment out the CGP code this transformation catches some of the same cases. llvm-svn: 365929 --- diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 1df41b9..62ed00b 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -3374,6 +3374,11 @@ inline static bool isDefConvertible(const MachineInstr &MI, bool &NoSignFlag) { static X86::CondCode isUseDefConvertible(const MachineInstr &MI) { switch (MI.getOpcode()) { default: return X86::COND_INVALID; + case X86::NEG8r: + case X86::NEG16r: + case X86::NEG32r: + case X86::NEG64r: + return X86::COND_AE; case X86::LZCNT16rr: case X86::LZCNT32rr: case X86::LZCNT64rr: