forked from OSchip/llvm-project
GlobalISel: add buildUndef method to MachineIRBuilder. NFC.
llvm-svn: 297044
This commit is contained in:
parent
fb1a0a0d2f
commit
81dafc1c88
|
@ -451,6 +451,9 @@ public:
|
|||
MachineInstrBuilder buildExtract(ArrayRef<unsigned> Results,
|
||||
ArrayRef<uint64_t> Indices, unsigned Src);
|
||||
|
||||
/// Build and insert \p Res = IMPLICIT_DEF.
|
||||
MachineInstrBuilder buildUndef(unsigned Dst);
|
||||
|
||||
/// Build and insert \p Res<def> = G_SEQUENCE \p Op0, \p Idx0...
|
||||
///
|
||||
/// G_SEQUENCE inserts each element of Ops into an IMPLICIT_DEF register,
|
||||
|
|
|
@ -986,7 +986,7 @@ bool IRTranslator::translate(const Constant &C, unsigned Reg) {
|
|||
else if (auto CF = dyn_cast<ConstantFP>(&C))
|
||||
EntryBuilder.buildFConstant(Reg, *CF);
|
||||
else if (isa<UndefValue>(C))
|
||||
EntryBuilder.buildInstr(TargetOpcode::IMPLICIT_DEF).addDef(Reg);
|
||||
EntryBuilder.buildUndef(Reg);
|
||||
else if (isa<ConstantPointerNull>(C))
|
||||
EntryBuilder.buildConstant(Reg, 0);
|
||||
else if (auto GV = dyn_cast<GlobalValue>(&C))
|
||||
|
|
|
@ -416,6 +416,10 @@ MachineIRBuilder::buildSequence(unsigned Res,
|
|||
return MIB;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MachineIRBuilder::buildUndef(unsigned Res) {
|
||||
return buildInstr(TargetOpcode::IMPLICIT_DEF).addDef(Res);
|
||||
}
|
||||
|
||||
MachineInstrBuilder MachineIRBuilder::buildMerge(unsigned Res,
|
||||
ArrayRef<unsigned> Ops) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue