Remove caching of the subtarget for AArch64SelectionDAGInfo.
authorEric Christopher <echristo@gmail.com>
Tue, 10 Jun 2014 18:06:25 +0000 (18:06 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 10 Jun 2014 18:06:25 +0000 (18:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210553 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64SelectionDAGInfo.cpp
lib/Target/AArch64/AArch64SelectionDAGInfo.h

index 0740b3d7e6f758924eaa04736351cc4a7982e9d9..a62c721c7e1c973fc8e7d85ba6c588d2643c87a3 100644 (file)
@@ -17,8 +17,7 @@ using namespace llvm;
 #define DEBUG_TYPE "aarch64-selectiondag-info"
 
 AArch64SelectionDAGInfo::AArch64SelectionDAGInfo(const TargetMachine &TM)
-    : TargetSelectionDAGInfo(TM.getDataLayout()),
-      Subtarget(&TM.getSubtarget<AArch64Subtarget>()) {}
+    : TargetSelectionDAGInfo(TM.getDataLayout()) {}
 
 AArch64SelectionDAGInfo::~AArch64SelectionDAGInfo() {}
 
@@ -30,7 +29,9 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset(
   ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
   ConstantSDNode *SizeValue = dyn_cast<ConstantSDNode>(Size);
   const char *bzeroEntry =
-      (V && V->isNullValue()) ? Subtarget->getBZeroEntry() : nullptr;
+      (V && V->isNullValue())
+          ? DAG.getTarget().getSubtarget<AArch64Subtarget>().getBZeroEntry()
+          : nullptr;
   // For small size (< 256), it is not beneficial to use bzero
   // instead of memset.
   if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) {
index 8381f9916a8cfcc97e688cf8be48c1f94d6e0049..c2e0c60dff010aa1df35430c7d8b058f34d56f38 100644 (file)
 namespace llvm {
 
 class AArch64SelectionDAGInfo : public TargetSelectionDAGInfo {
-  /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
-  /// make the right decision when generating code for different targets.
-  const AArch64Subtarget *Subtarget;
-
 public:
   explicit AArch64SelectionDAGInfo(const TargetMachine &TM);
   ~AArch64SelectionDAGInfo();