1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244604
This commit is contained in:
Sanjay Patel 2015-08-11 14:31:14 +00:00
parent 870596a89a
commit e13d1d30df
2 changed files with 6 additions and 7 deletions

View File

@ -426,9 +426,7 @@ bool MachineCombiner::runOnMachineFunction(MachineFunction &MF) {
MRI = &MF.getRegInfo();
Traces = &getAnalysis<MachineTraceMetrics>();
MinInstr = 0;
// FIXME: Use Function::optForSize().
OptSize = MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize);
OptSize = MF.getFunction()->optForSize();
DEBUG(dbgs() << getPassName() << ": " << MF.getName() << '\n');
if (!TII->useMachineCombiner()) {

View File

@ -37,10 +37,11 @@ define i128 @test_128bitmul_optsize(i128 %lhs, i128 %rhs) optsize {
define i128 @test_128bitmul_minsize(i128 %lhs, i128 %rhs) minsize {
; CHECK-LABEL: test_128bitmul_minsize:
; CHECK-DAG: mul [[PART1:x[0-9]+]], x0, x3
; CHECK-DAG: umulh [[CARRY:x[0-9]+]], x0, x2
; CHECK: mul [[PART2:x[0-9]+]], x1, x2
; CHECK: mul x0, x0, x2
; CHECK: umulh [[HI:x[0-9]+]], x0, x2
; CHECK-NEXT: madd [[TEMP1:x[0-9]+]], x0, x3, [[HI]]
; CHECK-NEXT: madd x1, x1, x2, [[TEMP1]]
; CHECK-NEXT: mul x0, x0, x2
; CHECK-NEXT: ret
%prod = mul i128 %lhs, %rhs
ret i128 %prod