llvm.org GIT mirror llvm / 8fc7057
fix minsize detection: minsize attribute implies optimizing for size git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244463 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 4 years ago
2 changed file(s) with 3 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
2412624126 return SDValue();
2412724127
2412824128 // fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
24129 MachineFunction &MF = DAG.getMachineFunction();
24130 // FIXME: Use Function::optForSize().
24131 bool OptForSize =
24132 MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize);
24129 bool OptForSize = DAG.getMachineFunction().getFunction()->optForSize();
2413324130
2413424131 // SHLD/SHRD instructions have lower register pressure, but on some
2413524132 // platforms they have higher latency than the equivalent
88 ; return (a << 10) | (b >> 54);
99 ; }
1010
11 ; Function Attrs: minsize nounwind optsize readnone uwtable
11 ; Function Attrs: minsize nounwind readnone uwtable
1212 define i64 @_Z8lshift10mm(i64 %a, i64 %b) #0 {
1313 entry:
1414 ; CHECK: shldq $10
1818 ret i64 %or
1919 }
2020
21 attributes #0 = { minsize nounwind optsize readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
21 attributes #0 = { minsize nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
2222
2323
2424 ; clang -Os -c test2.cpp -emit-llvm -S