From d967a878fab52807fe38d47bbe711ebf26d6f49f Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 10 Aug 2015 23:07:26 +0000 Subject: fix minsize detection: minsize attribute implies optimizing for size llvm-svn: 244528 --- llvm/lib/CodeGen/BranchFolding.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/BranchFolding.cpp') diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index f2d1bf0a51f..260ab537053 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -605,9 +605,7 @@ static bool ProfitableToMerge(MachineBasicBlock *MBB1, // branch instruction, which is likely to be smaller than the 2 // instructions that would be deleted in the merge. MachineFunction *MF = MBB1->getParent(); - if (EffectiveTailLen >= 2 && - // FIXME: Use Function::optForSize(). - MF->getFunction()->hasFnAttribute(Attribute::OptimizeForSize) && + if (EffectiveTailLen >= 2 && MF->getFunction()->optForSize() && (I1 == MBB1->begin() || I2 == MBB2->begin())) return true; -- cgit v1.2.3