Skip to content

Commit

Permalink
Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it…
Browse files Browse the repository at this point in the history
… to CodeGen/

It's a SelectionDAG thing, not a Target thing.

llvm-svn: 258939
  • Loading branch information
d0k committed Jan 27, 2016
1 parent c67cf31 commit f9172fd
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 110 deletions.
6 changes: 3 additions & 3 deletions llvm/include/llvm/CodeGen/SelectionDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MachineFunction;
class MDNode;
class SDDbgValue;
class TargetLowering;
class TargetSelectionDAGInfo;
class SelectionDAGTargetInfo;

class SDVTListNode : public FoldingSetNode {
friend struct FoldingSetTrait<SDVTListNode>;
Expand Down Expand Up @@ -178,7 +178,7 @@ void checkForCycles(const SelectionDAG *DAG, bool force = false);
///
class SelectionDAG {
const TargetMachine &TM;
const TargetSelectionDAGInfo *TSI;
const SelectionDAGTargetInfo *TSI;
const TargetLowering *TLI;
MachineFunction *MF;
LLVMContext *Context;
Expand Down Expand Up @@ -287,7 +287,7 @@ class SelectionDAG {
const TargetMachine &getTarget() const { return TM; }
const TargetSubtargetInfo &getSubtarget() const { return MF->getSubtarget(); }
const TargetLowering &getTargetLoweringInfo() const { return *TLI; }
const TargetSelectionDAGInfo &getSelectionDAGInfo() const { return *TSI; }
const SelectionDAGTargetInfo &getSelectionDAGInfo() const { return *TSI; }
LLVMContext *getContext() const {return Context; }

/// Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//==-- llvm/Target/TargetSelectionDAGInfo.h - SelectionDAG Info --*- C++ -*-==//
//==-- llvm/CodeGen/SelectionDAGTargetInfo.h - SelectionDAG Info -*- C++ -*-==//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -7,14 +7,14 @@
//
//===----------------------------------------------------------------------===//
//
// This file declares the TargetSelectionDAGInfo class, which targets can
// This file declares the SelectionDAGTargetInfo class, which targets can
// subclass to parameterize the SelectionDAG lowering and instruction
// selection process.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TARGET_TARGETSELECTIONDAGINFO_H
#define LLVM_TARGET_TARGETSELECTIONDAGINFO_H
#ifndef LLVM_CODEGEN_SELECTIONDAGTARGETINFO_H
#define LLVM_CODEGEN_SELECTIONDAGTARGETINFO_H

#include "llvm/CodeGen/SelectionDAGNodes.h"

Expand All @@ -24,13 +24,13 @@ namespace llvm {
/// Targets can subclass this to parameterize the
/// SelectionDAG lowering and instruction selection process.
///
class TargetSelectionDAGInfo {
TargetSelectionDAGInfo(const TargetSelectionDAGInfo &) = delete;
void operator=(const TargetSelectionDAGInfo &) = delete;
class SelectionDAGTargetInfo {
SelectionDAGTargetInfo(const SelectionDAGTargetInfo &) = delete;
void operator=(const SelectionDAGTargetInfo &) = delete;

public:
explicit TargetSelectionDAGInfo() = default;
virtual ~TargetSelectionDAGInfo();
explicit SelectionDAGTargetInfo() = default;
virtual ~SelectionDAGTargetInfo();

/// Emit target-specific code that performs a memcpy.
/// This can be used by targets to provide code sequences for cases
Expand All @@ -45,14 +45,10 @@ class TargetSelectionDAGInfo {
/// expanded in a place where calls are not feasible (e.g. within the prologue
/// for another call). If the target chooses to decline an AlwaysInline
/// request here, legalize will resort to using simple loads and stores.
virtual SDValue
EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl,
SDValue Chain,
SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, bool isVolatile,
bool AlwaysInline,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo) const {
virtual SDValue EmitTargetCodeForMemcpy(
SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, bool isVolatile, bool AlwaysInline,
MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const {
return SDValue();
}

Expand All @@ -62,13 +58,10 @@ class TargetSelectionDAGInfo {
/// more efficient than using a library call. This function can return a null
/// SDValue if the target declines to use custom code and a different
/// lowering strategy should be used.
virtual SDValue
EmitTargetCodeForMemmove(SelectionDAG &DAG, SDLoc dl,
SDValue Chain,
SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, bool isVolatile,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo) const {
virtual SDValue EmitTargetCodeForMemmove(
SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, bool isVolatile,
MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const {
return SDValue();
}

Expand All @@ -78,12 +71,11 @@ class TargetSelectionDAGInfo {
/// efficient than using a library call. This function can return a null
/// SDValue if the target declines to use custom code and a different
/// lowering strategy should be used.
virtual SDValue
EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl,
SDValue Chain,
SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, bool isVolatile,
MachinePointerInfo DstPtrInfo) const {
virtual SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl,
SDValue Chain, SDValue Op1,
SDValue Op2, SDValue Op3,
unsigned Align, bool isVolatile,
MachinePointerInfo DstPtrInfo) const {
return SDValue();
}

Expand All @@ -92,10 +84,9 @@ class TargetSelectionDAGInfo {
/// memcmp and the second is the chain. Both SDValues can be null if a normal
/// libcall should be used.
virtual std::pair<SDValue, SDValue>
EmitTargetCodeForMemcmp(SelectionDAG &DAG, SDLoc dl,
SDValue Chain,
SDValue Op1, SDValue Op2,
SDValue Op3, MachinePointerInfo Op1PtrInfo,
EmitTargetCodeForMemcmp(SelectionDAG &DAG, SDLoc dl, SDValue Chain,
SDValue Op1, SDValue Op2, SDValue Op3,
MachinePointerInfo Op1PtrInfo,
MachinePointerInfo Op2PtrInfo) const {
return std::make_pair(SDValue(), SDValue());
}
Expand All @@ -121,21 +112,17 @@ class TargetSelectionDAGInfo {
EmitTargetCodeForStrcpy(SelectionDAG &DAG, SDLoc DL, SDValue Chain,
SDValue Dest, SDValue Src,
MachinePointerInfo DestPtrInfo,
MachinePointerInfo SrcPtrInfo,
bool isStpcpy) const {
MachinePointerInfo SrcPtrInfo, bool isStpcpy) const {
return std::make_pair(SDValue(), SDValue());
}

/// Emit target-specific code that performs a strcmp, in cases where that is
/// faster than a libcall.
/// The first returned SDValue is the result of the strcmp and the second is
/// the chain. Both SDValues can be null if a normal libcall should be used.
virtual std::pair<SDValue, SDValue>
EmitTargetCodeForStrcmp(SelectionDAG &DAG, SDLoc dl,
SDValue Chain,
SDValue Op1, SDValue Op2,
MachinePointerInfo Op1PtrInfo,
MachinePointerInfo Op2PtrInfo) const {
virtual std::pair<SDValue, SDValue> EmitTargetCodeForStrcmp(
SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2,
MachinePointerInfo Op1PtrInfo, MachinePointerInfo Op2PtrInfo) const {
return std::make_pair(SDValue(), SDValue());
}

Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Target/TargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class TargetIntrinsicInfo;
class TargetLowering;
class TargetPassConfig;
class TargetRegisterInfo;
class TargetSelectionDAGInfo;
class TargetSubtargetInfo;
class TargetTransformInfo;
class formatted_raw_ostream;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Target/TargetSubtargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TargetLowering;
class TargetRegisterClass;
class TargetRegisterInfo;
class TargetSchedModel;
class TargetSelectionDAGInfo;
class SelectionDAGTargetInfo;
struct MachineSchedPolicy;
template <typename T> class SmallVectorImpl;

Expand Down Expand Up @@ -79,7 +79,7 @@ class TargetSubtargetInfo : public MCSubtargetInfo {
return nullptr;
}
virtual const TargetLowering *getTargetLowering() const { return nullptr; }
virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const {
virtual const SelectionDAGTargetInfo *getSelectionDAGInfo() const {
return nullptr;
}
/// Target can subclass this hook to select a different DAG scheduler.
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ add_llvm_library(LLVMSelectionDAG
ScheduleDAGFast.cpp
ScheduleDAGRRList.cpp
ScheduleDAGSDNodes.cpp
SelectionDAG.cpp
ScheduleDAGVLIW.cpp
SelectionDAGBuilder.cpp
SelectionDAG.cpp
SelectionDAGDumper.cpp
SelectionDAGISel.cpp
SelectionDAGPrinter.cpp
SelectionDAGTargetInfo.cpp
StatepointLowering.cpp
ScheduleDAGVLIW.cpp
TargetLowering.cpp
TargetSelectionDAGInfo.cpp
)

add_dependencies(LLVMSelectionDAG intrinsics_gen)
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
Expand All @@ -46,7 +47,6 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <algorithm>
#include <cmath>
Expand Down
14 changes: 7 additions & 7 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/WinEHFuncInfo.h"
#include "llvm/IR/CallingConv.h"
Expand Down Expand Up @@ -62,7 +63,6 @@
#include "llvm/Target/TargetIntrinsicInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <algorithm>
#include <utility>
Expand Down Expand Up @@ -5517,7 +5517,7 @@ bool SelectionDAGBuilder::visitMemCmpCall(const CallInst &I) {
return true;
}

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForMemcmp(DAG, getCurSDLoc(), DAG.getRoot(),
getValue(LHS), getValue(RHS), getValue(Size),
Expand Down Expand Up @@ -5614,7 +5614,7 @@ bool SelectionDAGBuilder::visitMemChrCall(const CallInst &I) {
!I.getType()->isPointerTy())
return false;

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForMemchr(DAG, getCurSDLoc(), DAG.getRoot(),
getValue(Src), getValue(Char), getValue(Length),
Expand Down Expand Up @@ -5642,7 +5642,7 @@ bool SelectionDAGBuilder::visitStrCpyCall(const CallInst &I, bool isStpcpy) {
!I.getType()->isPointerTy())
return false;

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForStrcpy(DAG, getCurSDLoc(), getRoot(),
getValue(Arg0), getValue(Arg1),
Expand Down Expand Up @@ -5671,7 +5671,7 @@ bool SelectionDAGBuilder::visitStrCmpCall(const CallInst &I) {
!I.getType()->isIntegerTy())
return false;

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForStrcmp(DAG, getCurSDLoc(), DAG.getRoot(),
getValue(Arg0), getValue(Arg1),
Expand All @@ -5698,7 +5698,7 @@ bool SelectionDAGBuilder::visitStrLenCall(const CallInst &I) {
if (!Arg0->getType()->isPointerTy() || !I.getType()->isIntegerTy())
return false;

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForStrlen(DAG, getCurSDLoc(), DAG.getRoot(),
getValue(Arg0), MachinePointerInfo(Arg0));
Expand All @@ -5725,7 +5725,7 @@ bool SelectionDAGBuilder::visitStrNLenCall(const CallInst &I) {
!I.getType()->isIntegerTy())
return false;

const TargetSelectionDAGInfo &TSI = DAG.getSelectionDAGInfo();
const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo();
std::pair<SDValue, SDValue> Res =
TSI.EmitTargetCodeForStrnlen(DAG, getCurSDLoc(), DAG.getRoot(),
getValue(Arg0), getValue(Arg1),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- TargetSelectionDAGInfo.cpp - SelectionDAG Info --------------------===//
//===-- SelectionDAGTargetInfo.cpp - SelectionDAG Info --------------------===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -7,13 +7,11 @@
//
//===----------------------------------------------------------------------===//
//
// This implements the TargetSelectionDAGInfo class.
// This implements the SelectionDAGTargetInfo class.
//
//===----------------------------------------------------------------------===//

#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
using namespace llvm;

TargetSelectionDAGInfo::~TargetSelectionDAGInfo() {
}
SelectionDAGTargetInfo::~SelectionDAGTargetInfo() {}
6 changes: 3 additions & 3 deletions llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines the AArch64 subclass for TargetSelectionDAGInfo.
// This file defines the AArch64 subclass for SelectionDAGTargetInfo.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64SELECTIONDAGINFO_H
#define LLVM_LIB_TARGET_AARCH64_AARCH64SELECTIONDAGINFO_H

#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"

namespace llvm {

class AArch64SelectionDAGInfo : public TargetSelectionDAGInfo {
class AArch64SelectionDAGInfo : public SelectionDAGTargetInfo {
public:

SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl, SDValue Chain,
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/ARM/ARMSelectionDAGInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines the ARM subclass for TargetSelectionDAGInfo.
// This file defines the ARM subclass for SelectionDAGTargetInfo.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
#define LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H

#include "MCTargetDesc/ARMAddressingModes.h"
#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"

namespace llvm {

Expand All @@ -35,7 +35,7 @@ namespace ARM_AM {
}
} // end namespace ARM_AM

class ARMSelectionDAGInfo : public TargetSelectionDAGInfo {
class ARMSelectionDAGInfo : public SelectionDAGTargetInfo {
public:

SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl,
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/AVR/AVRSelectionDAGInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines the AVR subclass for TargetSelectionDAGInfo.
// This file defines the AVR subclass for SelectionDAGTargetInfo.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_AVR_SELECTION_DAG_INFO_H
#define LLVM_AVR_SELECTION_DAG_INFO_H

#include "llvm/Target/TargetSelectionDAGInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"

namespace llvm {
/**
* Holds information about the AVR instruction selection DAG.
*/
class AVRSelectionDAGInfo : public TargetSelectionDAGInfo {
class AVRSelectionDAGInfo : public SelectionDAGTargetInfo {
public:
};

Expand Down
Loading

0 comments on commit f9172fd

Please sign in to comment.