Skip to content

Commit

Permalink
Sink AddrMode back into TargetLowering, removing one of the most
Browse files Browse the repository at this point in the history
peculiar headers under include/llvm.

This struct still doesn't make a lot of sense, but it makes more sense
down in TargetLowering than it did before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171739 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chandlerc committed Jan 7, 2013
1 parent a07dcb1 commit 56d433d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 45 deletions.
41 changes: 0 additions & 41 deletions include/llvm/AddressingMode.h

This file was deleted.

17 changes: 16 additions & 1 deletion include/llvm/Target/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define LLVM_TARGET_TARGETLOWERING_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/AddressingMode.h"
#include "llvm/CodeGen/DAGCombine.h"
#include "llvm/CodeGen/RuntimeLibcalls.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
Expand Down Expand Up @@ -1698,6 +1697,22 @@ class TargetLowering {
return false;
}

/// AddrMode - This represents an addressing mode of:
/// BaseGV + BaseOffs + BaseReg + Scale*ScaleReg
/// If BaseGV is null, there is no BaseGV.
/// If BaseOffs is zero, there is no base offset.
/// If HasBaseReg is false, there is no base register.
/// If Scale is zero, there is no ScaleReg. Scale of 1 indicates a reg with
/// no scale.
///
struct AddrMode {
GlobalValue *BaseGV;
int64_t BaseOffs;
bool HasBaseReg;
int64_t Scale;
AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {}
};

/// isLegalAddressingMode - Return true if the addressing mode represented by
/// AM is legal for this target, for a load/store of the specified type.
/// The type may be VoidTy, in which case only return true if the addressing
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/BasicTargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool BasicTTI::isLegalICmpImmediate(int64_t imm) const {
bool BasicTTI::isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
int64_t BaseOffset, bool HasBaseReg,
int64_t Scale) const {
AddrMode AM;
TargetLowering::AddrMode AM;
AM.BaseGV = BaseGV;
AM.BaseOffs = BaseOffset;
AM.HasBaseReg = HasBaseReg;
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6825,7 +6825,7 @@ static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
} else
return false;

AddrMode AM;
TargetLowering::AddrMode AM;
if (N->getOpcode() == ISD::ADD) {
ConstantSDNode *Offset = dyn_cast<ConstantSDNode>(N->getOperand(1));
if (Offset)
Expand Down
2 changes: 1 addition & 1 deletion lib/Transforms/Scalar/CodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ namespace {

/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode
/// which holds actual Value*'s for register values.
struct ExtAddrMode : public AddrMode {
struct ExtAddrMode : public TargetLowering::AddrMode {
Value *BaseReg;
Value *ScaledReg;
ExtAddrMode() : BaseReg(0), ScaledReg(0) {}
Expand Down

0 comments on commit 56d433d

Please sign in to comment.