[llvm] r244460 - fix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 09:47:48 PDT 2015
Author: spatel
Date: Mon Aug 10 11:47:47 2015
New Revision: 244460
URL: http://llvm.org/viewvc/llvm-project?rev=244460&view=rev
Log:
fix minsize detection: minsize attribute implies optimizing for size
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/test/CodeGen/X86/splat-for-size.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=244460&r1=244459&r2=244460&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Aug 10 11:47:47 2015
@@ -462,8 +462,7 @@ static bool isCalleeLoad(SDValue Callee,
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; ) {
Modified: llvm/trunk/test/CodeGen/X86/splat-for-size.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/splat-for-size.ll?rev=244460&r1=244459&r2=244460&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/splat-for-size.ll (original)
+++ llvm/trunk/test/CodeGen/X86/splat-for-size.ll Mon Aug 10 11:47:47 2015
@@ -43,7 +43,7 @@ define <8 x float> @splat_v8f32(<8 x flo
; 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, <i64 1, i64 1>
ret <2 x i64> %add
; CHECK-LABEL: splat_v2i64
More information about the llvm-commits
mailing list