summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/RISCV/RISCVISelLowering.h
diff options
context:
space:
mode:
authorSimon Cook <simon.cook@embecosm.com>2019-10-22 21:25:01 +0100
committerSimon Cook <simon.cook@embecosm.com>2019-10-22 21:25:01 +0100
commitaed9d6d64a38d155cd09232da5640b5ade069bd9 (patch)
tree039d8d57a1065a034a383b13a5448fa7c993704a /llvm/lib/Target/RISCV/RISCVISelLowering.h
parent68f5ca4e19c16f12895a6f0b9fbabc1d86c4b6b0 (diff)
downloadbcm5719-llvm-aed9d6d64a38d155cd09232da5640b5ade069bd9.tar.gz
bcm5719-llvm-aed9d6d64a38d155cd09232da5640b5ade069bd9.zip
[RISCV] Add support for -ffixed-xX flags
This adds support for reserving GPRs such that the compiler will not choose a register for register allocation. The implementation follows the same design as for AArch64; each reserved register becomes a target feature and used for getting the reserved registers for a given MachineFunction. The backend checks that it does not need to write to any reserved register; if it does a relevant error is generated. Differential Revision: https://reviews.llvm.org/D67185
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVISelLowering.h')
-rw-r--r--llvm/lib/Target/RISCV/RISCVISelLowering.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.h b/llvm/lib/Target/RISCV/RISCVISelLowering.h
index 18fc7350bbb..0d2d14e8d67 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.h
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.h
@@ -210,6 +210,12 @@ private:
Value *AlignedAddr, Value *CmpVal,
Value *NewVal, Value *Mask,
AtomicOrdering Ord) const override;
+
+ /// Generate error diagnostics if any register used by CC has been marked
+ /// reserved.
+ void validateCCReservedRegs(
+ const SmallVectorImpl<std::pair<llvm::Register, llvm::SDValue>> &Regs,
+ MachineFunction &MF) const;
};
}
OpenPOWER on IntegriCloud