[llvm] r244499 - fix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 13:45:44 PDT 2015
Author: spatel
Date: Mon Aug 10 15:45:44 2015
New Revision: 244499
URL: http://llvm.org/viewvc/llvm-project?rev=244499&view=rev
Log:
fix minsize detection: minsize attribute implies optimizing for size
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
llvm/trunk/test/CodeGen/X86/sse_partial_update.ll
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=244499&r1=244498&r2=244499&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Aug 10 15:45:44 2015
@@ -5347,11 +5347,8 @@ MachineInstr *X86InstrInfo::foldMemoryOp
// Check switch flag
if (NoFusing) return nullptr;
- // Unless optimizing for size, don't fold to avoid partial
- // register update stalls
- // FIXME: Use Function::optForSize().
- if (!MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize) &&
- hasPartialRegUpdate(MI->getOpcode()))
+ // Avoid partial register update stalls unless optimizing for size.
+ if (!MF.getFunction()->optForSize() && hasPartialRegUpdate(MI->getOpcode()))
return nullptr;
// Determine the alignment of the load.
Modified: llvm/trunk/test/CodeGen/X86/sse_partial_update.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse_partial_update.ll?rev=244499&r1=244498&r2=244499&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sse_partial_update.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sse_partial_update.ll Mon Aug 10 15:45:44 2015
@@ -113,9 +113,8 @@ define <2 x double> @load_fold_cvtss2sd_
define <2 x double> @load_fold_cvtss2sd_int_minsize(<4 x float> *%a) minsize {
; CHECK-LABEL: load_fold_cvtss2sd_int_minsize:
-; CHECK: movaps (%rdi), %xmm1
-; CHECK-NEXT: xorps %xmm0, %xmm0
-; CHECK-NEXT: cvtss2sd %xmm1, %xmm0
+; CHECK: xorps %xmm0, %xmm0
+; CHECK-NEXT: cvtss2sd (%rdi), %xmm0
; CHECK-NEXT: retq
%ld = load <4 x float>, <4 x float> *%a
%x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> <double 0x0, double 0x0>, <4 x float> %ld)
More information about the llvm-commits
mailing list