[PATCH] D14407: [WinEH] Mark funclet entries and exits as clobbering all registers

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 08:52:07 PST 2015


rnk added a comment.

In http://reviews.llvm.org/D14407#283135, @JosephTremoulet wrote:

> Should you also be removing the FIXME code in X86ISelLowering.cpp (~line 3445) that sets the noPreserved mask on invokes (with 32-bit funclet personalities)?  I don't see that here.


I can't remove that yet because it also informs PEI that it needs to push all non-volatile registers in the prologue. We *don't* want that behavior for x64, because the runtime takes care of it for us, and redundantly saving all callee-saved XMM registers is expensive.

I think the right way to handle that is to put a nothing-preserved mask on EH_RESTORE instructions, which corresponds to where control rejoins an outer scope after a CATCHRET. That way, 32-bit functions using only cleanups will not need to spill all CSRs.


================
Comment at: lib/Target/ARM/ARMBaseRegisterInfo.h:97
@@ -96,3 +96,3 @@
                                        CallingConv::ID) const override;
-  const uint32_t *getNoPreservedMask() const;
+  const uint32_t *getNoPreservedMask() const override;
 
----------------
The implementations already exist, I only made the method virtual. I'll make the default behavior be fatal error.


http://reviews.llvm.org/D14407





More information about the llvm-commits mailing list