/// Returns a 0 terminated array of rounding control registers that can be
/// attached into strict FP call.
- virtual const MCPhysReg *getRoundingControlRegisters() const {
- return nullptr;
+ virtual ArrayRef<MCPhysReg> getRoundingControlRegisters() const {
+ return ArrayRef<MCPhysReg>();
}
/// This callback is used to prepare for a volatile or atomic load.
// Add rounding control registers as implicit def for function call.
if (II.isCall() && MF->getFunction().hasFnAttribute(Attribute::StrictFP)) {
- const MCPhysReg *RCRegs = TLI->getRoundingControlRegisters();
- if (RCRegs)
- for (; *RCRegs; ++RCRegs)
- UsedRegs.push_back(*RCRegs);
+ ArrayRef<MCPhysReg> RCRegs = TLI->getRoundingControlRegisters();
+ for (MCPhysReg Reg : RCRegs)
+ UsedRegs.push_back(Reg);
}
// Finally mark unused registers as dead.
return ScratchRegs;
}
-const MCPhysReg *AArch64TargetLowering::getRoundingControlRegisters() const {
- static const MCPhysReg RCRegs[] = {AArch64::FPCR, 0};
+ArrayRef<MCPhysReg> AArch64TargetLowering::getRoundingControlRegisters() const {
+ static const MCPhysReg RCRegs[] = {AArch64::FPCR};
return RCRegs;
}
CodeGenOpt::Level OptLevel) const override;
const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
- const MCPhysReg *getRoundingControlRegisters() const override;
+ ArrayRef<MCPhysReg> getRoundingControlRegisters() const override;
/// Returns false if N is a bit extraction pattern of (X >> C) & Mask.
bool isDesirableToCommuteWithShift(const SDNode *N,
return ScratchRegs;
}
-const MCPhysReg *X86TargetLowering::getRoundingControlRegisters() const {
+ArrayRef<MCPhysReg> X86TargetLowering::getRoundingControlRegisters() const {
// FIXME: We should def X86::FPCW for x87 as well. But it affects a lot of lit
// tests at the moment, which is not what we expected.
- static const MCPhysReg RCRegs[] = { X86::MXCSR, 0 };
+ static const MCPhysReg RCRegs[] = {X86::MXCSR};
return RCRegs;
}
LLVMContext &Context) const override;
const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
- const MCPhysReg *getRoundingControlRegisters() const override;
+ ArrayRef<MCPhysReg> getRoundingControlRegisters() const override;
TargetLoweringBase::AtomicExpansionKind
shouldExpandAtomicLoadInIR(LoadInst *LI) const override;