mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 12:02:58 +02:00
fix minsize detection: minsize attribute implies optimizing for size
llvm-svn: 244463
This commit is contained in:
parent
ea9a1cc024
commit
5fcdfefe10
@ -24127,10 +24127,7 @@ static SDValue PerformOrCombine(SDNode *N, SelectionDAG &DAG,
|
||||
return SDValue();
|
||||
|
||||
// fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
// FIXME: Use Function::optForSize().
|
||||
bool OptForSize =
|
||||
MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize);
|
||||
bool OptForSize = DAG.getMachineFunction().getFunction()->optForSize();
|
||||
|
||||
// SHLD/SHRD instructions have lower register pressure, but on some
|
||||
// platforms they have higher latency than the equivalent
|
||||
|
@ -9,7 +9,7 @@
|
||||
; return (a << 10) | (b >> 54);
|
||||
; }
|
||||
|
||||
; Function Attrs: minsize nounwind optsize readnone uwtable
|
||||
; Function Attrs: minsize nounwind readnone uwtable
|
||||
define i64 @_Z8lshift10mm(i64 %a, i64 %b) #0 {
|
||||
entry:
|
||||
; CHECK: shldq $10
|
||||
@ -19,7 +19,7 @@ entry:
|
||||
ret i64 %or
|
||||
}
|
||||
|
||||
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" }
|
||||
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" }
|
||||
|
||||
|
||||
; clang -Os -c test2.cpp -emit-llvm -S
|
||||
|
Loading…
Reference in New Issue
Block a user