From d5bcb1b02299d59ab639dcd63cca02420113faf8 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sun, 6 Jan 2019 16:21:42 +0000 Subject: [PATCH] [x86] explicitly set cost of integer add/sub There are no test changes here in the existing cost model regression tests because integer add/sub have a default legal cost of 1 already. This would break, however, if we custom lower those ops because the default cost model assumes that custom-lowered ops are more expensive. This is similar to the change in rL350403. See discussion in D56011 for more details. When we enhance that patch to handle integer ops, we need this cost model change to avoid unintended diffs here from the custom lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350496 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86TargetTransformInfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Target/X86/X86TargetTransformInfo.cpp b/lib/Target/X86/X86TargetTransformInfo.cpp index bce3a061b8e..a3592565c0f 100644 --- a/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/lib/Target/X86/X86TargetTransformInfo.cpp @@ -853,6 +853,14 @@ int X86TTIImpl::getArithmeticInstrCost( { ISD::FSUB, MVT::f32, 1 }, // Pentium III from http://www.agner.org/ { ISD::FSUB, MVT::v4f32, 2 }, // Pentium III from http://www.agner.org/ + + { ISD::ADD, MVT::i8, 1 }, // Pentium III from http://www.agner.org/ + { ISD::ADD, MVT::i16, 1 }, // Pentium III from http://www.agner.org/ + { ISD::ADD, MVT::i32, 1 }, // Pentium III from http://www.agner.org/ + + { ISD::SUB, MVT::i8, 1 }, // Pentium III from http://www.agner.org/ + { ISD::SUB, MVT::i16, 1 }, // Pentium III from http://www.agner.org/ + { ISD::SUB, MVT::i32, 1 }, // Pentium III from http://www.agner.org/ }; if (ST->hasSSE1()) -- 2.50.1