mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230000 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -28,15 +28,14 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset(
|
|||||||
// Check to see if there is a specialized entry-point for memory zeroing.
|
// Check to see if there is a specialized entry-point for memory zeroing.
|
||||||
ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
|
ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
|
||||||
ConstantSDNode *SizeValue = dyn_cast<ConstantSDNode>(Size);
|
ConstantSDNode *SizeValue = dyn_cast<ConstantSDNode>(Size);
|
||||||
|
const AArch64Subtarget &STI =
|
||||||
|
DAG.getMachineFunction().getSubtarget<AArch64Subtarget>();
|
||||||
const char *bzeroEntry =
|
const char *bzeroEntry =
|
||||||
(V && V->isNullValue())
|
(V && V->isNullValue()) ? STI.getBZeroEntry() : nullptr;
|
||||||
? DAG.getTarget().getSubtarget<AArch64Subtarget>().getBZeroEntry()
|
|
||||||
: nullptr;
|
|
||||||
// For small size (< 256), it is not beneficial to use bzero
|
// For small size (< 256), it is not beneficial to use bzero
|
||||||
// instead of memset.
|
// instead of memset.
|
||||||
if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) {
|
if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) {
|
||||||
const AArch64TargetLowering &TLI =
|
const AArch64TargetLowering &TLI = *STI.getTargetLowering();
|
||||||
*DAG.getTarget().getSubtarget<AArch64Subtarget>().getTargetLowering();
|
|
||||||
|
|
||||||
EVT IntPtr = TLI.getPointerTy();
|
EVT IntPtr = TLI.getPointerTy();
|
||||||
Type *IntPtrTy = getDataLayout()->getIntPtrType(*DAG.getContext());
|
Type *IntPtrTy = getDataLayout()->getIntPtrType(*DAG.getContext());
|
||||||
|
@@ -59,7 +59,7 @@ MipsTargetStreamer &MipsAsmPrinter::getTargetStreamer() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||||
Subtarget = &TM.getSubtarget<MipsSubtarget>();
|
Subtarget = &MF.getSubtarget<MipsSubtarget>();
|
||||||
|
|
||||||
// Initialize TargetLoweringObjectFile.
|
// Initialize TargetLoweringObjectFile.
|
||||||
const_cast<TargetLoweringObjectFile &>(getObjFileLowering())
|
const_cast<TargetLoweringObjectFile &>(getObjFileLowering())
|
||||||
|
Reference in New Issue
Block a user