[PATCH] D92695: [X86ISelLowering] don't emit frame pointers for eflags intrinsics.

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 17:21:22 PST 2020


majnemer added a comment.

It is difficult remembering exactly what my thought process was way back when but the redzone calculation seems very likely...

Lets see...

011980cd50d5ddc5112c8440ffe9161de60b40ae was where I first implemented these intrinsics.

Looking at the Win64 ABI, there is this bit <https://docs.microsoft.com/en-us/cpp/build/stack-usage?view=msvc-160#function-types:~:text=A%20leaf%20function%20is%20one%20that,to%20any%20nonvolatile%20registers%2C%20including%20RSP>:

> A leaf function is one that does not require a function table entry. It can't make changes to any nonvolatile registers, including RSP, which means that it can't call any functions or allocate stack space.

Using these intrinsics must not violate this rule of the ABI so I forced frame pointers across all platforms.

The Linux ABI for x86-64 says that there are 128-bytes reserved for leaf functions. IIRC, forcing a frame pointer here also handled some complicated accounting issue of when or how much redzone we had to play with because this intrinsic allocates some stack...

+1 to @craig.topper's comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92695/new/

https://reviews.llvm.org/D92695



More information about the llvm-commits mailing list