summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-01-06 16:21:42 +0000
committerSanjay Patel <spatel@rotateright.com>2019-01-06 16:21:42 +0000
commit8f12e8f3f665cd2ae120cbcd7a7fab308673168f (patch)
tree21a51d0e089bacf01db8a1845ec113954157a15c
parent7d34906f31621eda7e01c2cd7afa9eeea257ce31 (diff)
downloadbcm5719-llvm-8f12e8f3f665cd2ae120cbcd7a7fab308673168f.tar.gz
bcm5719-llvm-8f12e8f3f665cd2ae120cbcd7a7fab308673168f.zip
[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. llvm-svn: 350496
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index bce3a061b8e..a3592565c0f 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/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())
OpenPOWER on IntegriCloud