summaryrefslogtreecommitdiff
path: root/test/Driver/frame-pointer-elim.c
Commit message (Collapse)AuthorAgeFilesLines
* clang: Don't warn on unused momit-leaf-frame-pointer when frame pointers are ↵Nico Weber2019-08-131-0/+10
| | | | | | | | | | | | | | | | | | | | off. This fixes a regression from r365860: As that commit message states, there are 3 valid states targeted by the combination of -f(no-)omit-frame-pointer and -m(no-)omit-leaf-frame-pointer. After r365860 it's impossible to get from state 10 (omit just leaf frame pointers) to state 11 (omit all frame pointers) in a single command line without getting a warning. This change restores that functionality. Fixes PR42966. Differential Revision: https://reviews.llvm.org/D66142 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368728 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Replace cc1 options '-mdisable-fp-elim' and '-momit-leaf-frame-pointer'Yuanfang Chen2019-07-201-14/+6
| | | | | | | | | | | | | | | | with '-mframe-pointer' After D56351 and D64294, frame pointer handling is migrated to tri-state (all, non-leaf, none) in clang driver and on the function attribute. This patch makes the frame pointer handling cc1 option tri-state. Reviewers: chandlerc, rnk, t.p.northover, MaskRay Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D56353 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366645 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Default to -fomit-frame-pointer when optimization is enabledFangrui Song2019-07-121-0/+5
| | | | | | | NetBSD, Linux, CloudABI and Hurd already omit frame pointer for PowerPC. Make it do so for other platforms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365862 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor interaction between -f(no-)?omit-frame-pointer and ↵Fangrui Song2019-07-121-27/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -m(no-)?omit-leaf-frame-pointer Use a tri-state enum to represent shouldUseFramePointer() and shouldUseLeafFramePointer(). This simplifies the logic and fixes PR9825: -fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer. and PR24003: /Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32. (/Oy- is a no-op on MSVC x86-64.) and: when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer can also be omitted. The new behavior matches GCC: -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer The behavior makes lots of sense. We have 4 states: - 00) leaf retained, non-leaf retained - 01) leaf retained, non-leaf omitted (this is invalid) - 10) leaf omitted, non-leaf retained (what -momit-leaf-frame-pointer was designed for) - 11) leaf omitted, non-leaf omitted "omit" options taking precedence over "no-omit" options is the only way to make 3 valid states representable with -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-pointer. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D64294 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365860 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert enabling frame pointer elimination on OpenBSD for now.Brad Smith2019-06-281-13/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364679 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable frame pointer elimination for OpenBSD on powerpc.Brad Smith2019-04-191-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358775 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable frame pointer elimination for OpenBSD on x86 and mips64.Brad Smith2019-04-121-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358245 91177308-0d34-0410-b5e6-96231b3b80d8
* For NetBSD, unwind data is emitted by default, so also enable frameJoerg Sonnenberger2018-07-171-0/+9
| | | | | | | pointer optimisation by default when using optimisation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337274 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM-Darwin: re-enable -momit-leaf-frame-pointer.Tim Northover2017-01-271-2/+2
| | | | | | | | | | | | In r279546 I disabled all frame pointer elimination at the front-end on ARM-Darwin (and warned about it) because before that the backend had been silently ignoring these options. It turns out we didn't ignore -momit-leaf-frame-pointer though, just the more general -fomit-frame-pointer. So this re-enables passing that down to CodeGen so that everything really does continue working as before (with better diagnostics). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293311 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding an additional test to ensure the frame pointer is emittedDouglas Yung2016-08-241-0/+2
| | | | | | | | when compiling with optimization when PS4 is the target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279603 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM-Darwin: ignore and diagnose attempts to omit frame pointer.Tim Northover2016-08-231-0/+18
| | | | | | | | | | iOS (and other 32-bit ARM variants) always require a valid frame pointer to improve backtraces. Previously the -fomit-frame-pointer and -momit-leaf-frame-pointer options were being silently discarded via hacks in the backend. It's better if Clang configures itself to emit the correct IR and warns about (ignored) attempts to override this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279546 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass in frame pointer omitting compiler flags for CloudABI as well.Ed Schouten2016-08-111-0/+9
| | | | | | | | | | | On Linux we pass in -fomit-frame-pointer flags (and similar) automatically if optimization is enabled. Let's do the same thing on CloudABI. Without this, Clang seems to run out of registers quite quickly while trying to build code with inline assembly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278393 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typoFilipe Cabecinhas2015-01-311-1/+1
| | | | | | We're not that much into metals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227696 91177308-0d34-0410-b5e6-96231b3b80d8
* Shuffle tests around to more appropriate filesFilipe Cabecinhas2015-01-301-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227592 91177308-0d34-0410-b5e6-96231b3b80d8
* Move this file into the correct directory.Eric Christopher2013-04-031-0/+30
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178607 91177308-0d34-0410-b5e6-96231b3b80d8