From dcdac836ab6f8cd9d0d0f49f9a4ea9443b3be636 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Tue, 13 Jan 2015 17:47:59 +0000 Subject: [PATCH] [StackMaps] Allow the target to pre-process the live-out mask Some targets, PowerPC for example, have pseudo-registers (such as that used to represent the rounding mode), that don't have DWARF register numbers or a register class. These are used only for internal dependency tracking, and should not appear in the recorded live-outs. This adds a callback allowing the target to pre-process the live-out mask in order to remove these kinds of registers so that the StackMaps code does not complain about them and/or attempt to include them in the output. This will be used by the PowerPC target in a future commit. llvm-svn: 225805 --- include/llvm/Target/TargetRegisterInfo.h | 5 +++++ lib/CodeGen/StackMapLivenessAnalysis.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h index d5c048e010e..a7552565c93 100644 --- a/include/llvm/Target/TargetRegisterInfo.h +++ b/include/llvm/Target/TargetRegisterInfo.h @@ -456,6 +456,11 @@ public: /// used by register scavenger to determine what registers are free. virtual BitVector getReservedRegs(const MachineFunction &MF) const = 0; + /// Prior to adding the live-out mask to a stackmap or patchpoint + /// instruction, provide the target the opportunity to adjust it (mainly to + /// remove pseudo-registers that should be ignored). + virtual void adjustStackMapLiveOutMask(uint32_t *Mask) const { } + /// getMatchingSuperReg - Return a super-register of the specified register /// Reg so its sub-register of index SubIdx is Reg. unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx, diff --git a/lib/CodeGen/StackMapLivenessAnalysis.cpp b/lib/CodeGen/StackMapLivenessAnalysis.cpp index c2ee87a3de8..767f43a420f 100644 --- a/lib/CodeGen/StackMapLivenessAnalysis.cpp +++ b/lib/CodeGen/StackMapLivenessAnalysis.cpp @@ -123,5 +123,7 @@ uint32_t *StackMapLiveness::createRegisterMask() const { for (LivePhysRegs::const_iterator RI = LiveRegs.begin(), RE = LiveRegs.end(); RI != RE; ++RI) Mask[*RI / 32] |= 1U << (*RI % 32); + + TRI->adjustStackMapLiveOutMask(Mask); return Mask; }