aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
diff options
context:
space:
mode:
authorChen Zheng <czhengsz@cn.ibm.com>2022-12-12 09:53:53 +0000
committerChen Zheng <czhengsz@cn.ibm.com>2023-02-14 02:39:22 +0000
commit6ee2f770efb6b1b02438db025af0899ed5bf9313 (patch)
tree8e0c50d32af5576d8d5bb937b054c7a3be7445da /llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
parent5561e174117ff395d65b6978d04b62c1a1275138 (diff)
downloadllvm-6ee2f770efb6b1b02438db025af0899ed5bf9313.zip
llvm-6ee2f770efb6b1b02438db025af0899ed5bf9313.tar.gz
llvm-6ee2f770efb6b1b02438db025af0899ed5bf9313.tar.bz2
[PowerPC][GISel] add support for fpconstant
Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D133340
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 9100e06..c26f737 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -164,6 +164,15 @@ MachineInstrBuilder MachineIRBuilder::buildGlobalValue(const DstOp &Res,
return MIB;
}
+MachineInstrBuilder MachineIRBuilder::buildConstantPool(const DstOp &Res,
+ unsigned Idx) {
+ assert(Res.getLLTTy(*getMRI()).isPointer() && "invalid operand type");
+ auto MIB = buildInstr(TargetOpcode::G_CONSTANT_POOL);
+ Res.addDefToMIB(*getMRI(), MIB);
+ MIB.addConstantPoolIndex(Idx);
+ return MIB;
+}
+
MachineInstrBuilder MachineIRBuilder::buildJumpTable(const LLT PtrTy,
unsigned JTI) {
return buildInstr(TargetOpcode::G_JUMP_TABLE, {PtrTy}, {})