summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/CodeGen/TargetRegisterInfo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
index dd88f250a21..8c98d626b6d 100644
--- a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
@@ -87,11 +87,20 @@ public:
/// Return true if the specified register is included in this register class.
/// This does not include virtual registers.
bool contains(unsigned Reg) const {
+ /// FIXME: Historically this function has returned false when given vregs
+ /// but it should probably only receive physical registers
+ if (!Register::isPhysicalRegister(Reg))
+ return false;
return MC->contains(Reg);
}
/// Return true if both registers are in this class.
bool contains(unsigned Reg1, unsigned Reg2) const {
+ /// FIXME: Historically this function has returned false when given a vregs
+ /// but it should probably only receive physical registers
+ if (!Register::isPhysicalRegister(Reg1) ||
+ !Register::isPhysicalRegister(Reg2))
+ return false;
return MC->contains(Reg1, Reg2);
}
OpenPOWER on IntegriCloud