aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVSubtarget.cpp')
-rw-r--r--llvm/lib/Target/RISCV/RISCVSubtarget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
index 3b43be3..926cc9ea 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
@@ -69,6 +69,12 @@ static cl::opt<bool> UseMIPSCCMovInsn("use-riscv-mips-ccmov",
cl::desc("Use 'mips.ccmov' instruction"),
cl::init(true), cl::Hidden);
+static cl::opt<bool> EnablePExtCodeGen(
+ "enable-p-ext-codegen",
+ cl::desc("Turn on P Extension codegen(This is a temporary switch where "
+ "only partial codegen is currently supported)"),
+ cl::init(false), cl::Hidden);
+
void RISCVSubtarget::anchor() {}
RISCVSubtarget &
@@ -145,6 +151,10 @@ bool RISCVSubtarget::useConstantPoolForLargeInts() const {
return !RISCVDisableUsingConstantPoolForLargeInts;
}
+bool RISCVSubtarget::enablePExtCodeGen() const {
+ return HasStdExtP && EnablePExtCodeGen;
+}
+
unsigned RISCVSubtarget::getMaxBuildIntsCost() const {
// Loading integer from constant pool needs two instructions (the reason why
// the minimum cost is 2): an address calculation instruction and a load