aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-01-01 06:50:01 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-01-01 06:50:01 +0000
commit011980cd50d5ddc5112c8440ffe9161de60b40ae (patch)
treeb9c31e0645af28137517d9f789e3a7deb3c25cbc /llvm/lib/CodeGen/MachineInstr.cpp
parent88ddef7b174c82d0c9da5d0a21c0dcd6a181e828 (diff)
downloadllvm-011980cd50d5ddc5112c8440ffe9161de60b40ae.zip
llvm-011980cd50d5ddc5112c8440ffe9161de60b40ae.tar.gz
llvm-011980cd50d5ddc5112c8440ffe9161de60b40ae.tar.bz2
[X86] Add intrinsics for reading and writing to the flags register
LLVM's targets need to know if stack pointer adjustments occur after the prologue. This is needed to correctly determine if the red-zone is appropriate to use or if a frame pointer is required. Normally, LLVM can figure this out very precisely by reasoning about the contents of the MachineFunction. There is an interesting corner case: inline assembly. The vast majority of inline assembly which will perform a push or pop is done so to pair up with pushf or popf as appropriate. Unfortunately, this inline assembly doesn't mark the stack pointer as clobbered because, well, it isn't. The stack pointer is decremented and then immediately incremented. Because of this, LLVM was changed in r256456 to conservatively assume that inline assembly contain a sequence of stack operations. This is unfortunate because the vast majority of inline assembly will not end up manipulating the stack pointer in any way at all. Instead, let's provide a more principled solution: an intrinsic. FWIW, other compilers (MSVC and GCC among them) also provide this functionality as an intrinsic. llvm-svn: 256685
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions