diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2015-08-10 17:00:44 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2015-08-10 17:00:44 +0000 |
| commit | 0f12d71b496ee62f879e432165c8871d3cad6712 (patch) | |
| tree | 2ced6ccbfa7ae2a530ced13570ef1554916c9902 /llvm | |
| parent | 08142fa6c7d63ad0a822e1e572a9c86478ba2737 (diff) | |
| download | bcm5719-llvm-0f12d71b496ee62f879e432165c8871d3cad6712.tar.gz bcm5719-llvm-0f12d71b496ee62f879e432165c8871d3cad6712.zip | |
fix minsize detection: minsize attribute implies optimizing for size
llvm-svn: 244463
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 5 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index b6f34bd3a18..6dd4fb8d98e 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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 diff --git a/llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll b/llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll index 08d0257a0e5..ba559aa2ff0 100644 --- a/llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll +++ b/llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll @@ -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 |

