From 3ee30d060764a80f5c9d8ed8cc09194a399aed2b Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 20 Feb 2015 08:39:06 +0000 Subject: Get the cached subtarget off the MachineFunction rather than inquiring for a new one from the TargetMachine. llvm-svn: 230000 --- llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/AArch64') diff --git a/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp b/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp index 0cfd5826aad..b9c53998752 100644 --- a/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp @@ -28,15 +28,14 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset( // Check to see if there is a specialized entry-point for memory zeroing. ConstantSDNode *V = dyn_cast(Src); ConstantSDNode *SizeValue = dyn_cast(Size); + const AArch64Subtarget &STI = + DAG.getMachineFunction().getSubtarget(); const char *bzeroEntry = - (V && V->isNullValue()) - ? DAG.getTarget().getSubtarget().getBZeroEntry() - : nullptr; + (V && V->isNullValue()) ? STI.getBZeroEntry() : nullptr; // For small size (< 256), it is not beneficial to use bzero // instead of memset. if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) { - const AArch64TargetLowering &TLI = - *DAG.getTarget().getSubtarget().getTargetLowering(); + const AArch64TargetLowering &TLI = *STI.getTargetLowering(); EVT IntPtr = TLI.getPointerTy(); Type *IntPtrTy = getDataLayout()->getIntPtrType(*DAG.getContext()); -- cgit v1.2.3