From: Sanjay Patel Date: Mon, 10 Aug 2015 16:47:47 +0000 (+0000) Subject: fix minsize detection: minsize attribute implies optimizing for size X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abdf937a221ead2d1abeb5282340483817e1a908;p=llvm fix minsize detection: minsize attribute implies optimizing for size git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244460 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index d7be9fe238c..34ea3b78109 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -462,8 +462,7 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) { void X86DAGToDAGISel::PreprocessISelDAG() { // OptForSize is used in pattern predicates that isel is matching. - // FIXME: Use Function::optForSize(). - OptForSize = MF->getFunction()->hasFnAttribute(Attribute::OptimizeForSize); + OptForSize = MF->getFunction()->optForSize(); for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(), E = CurDAG->allnodes_end(); I != E; ) { diff --git a/test/CodeGen/X86/splat-for-size.ll b/test/CodeGen/X86/splat-for-size.ll index 916410a6244..6469786d879 100644 --- a/test/CodeGen/X86/splat-for-size.ll +++ b/test/CodeGen/X86/splat-for-size.ll @@ -43,7 +43,7 @@ define <8 x float> @splat_v8f32(<8 x float> %x) #1 { ; AVX can't do integer splats, so fake it: use vmovddup to splat 64-bit value. ; We also generate vmovddup for AVX2 because it's one byte smaller than vpbroadcastq. -define <2 x i64> @splat_v2i64(<2 x i64> %x) #0 { +define <2 x i64> @splat_v2i64(<2 x i64> %x) #1 { %add = add <2 x i64> %x, ret <2 x i64> %add ; CHECK-LABEL: splat_v2i64