From 3ac6db2dba3799046ee086fd885655c22bb2420f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 25 Nov 2014 15:19:25 +0000 Subject: TargetRegisterInfo: Add target query subRegWriteClobbersSuperReg() This allows targets to specify wheather or not is is possible to write to a sub-register without affecting other sub-registers in the same super-reg. --- include/llvm/Target/TargetRegisterInfo.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h index 16b72a98db0..88157f89310 100644 --- a/include/llvm/Target/TargetRegisterInfo.h +++ b/include/llvm/Target/TargetRegisterInfo.h @@ -818,6 +818,19 @@ public: const TargetRegisterClass *NewRC) const { return true; } + /// \returns true if a write to \p SubIdx clobbers values in non-overlaping + /// sub-registers of this super register. + /// For Example: + /// + /// %vreg1:sub1 = LOAD %vreg0, Reg64:%vreg1 Reg64:%vreg0 + /// + /// If the LOAD instruction modifies the value of vreg1:sub0, then this + /// function should return true. + virtual bool subRegWriteClobbersSuperReg(const TargetRegisterClass *RC, + unsigned SubIdx) const { + return true; + } + //===--------------------------------------------------------------------===// /// Debug information queries. -- cgit v1.2.3