Add address space argument to isLegalAddressingMode

This is important because of different addressing modes
depending on the address space for GPU targets.

This only adds the argument, and does not update
any of the uses to provide the correct address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault
2015-06-01 05:31:59 +00:00
parent d84c8ef1be
commit 5f3a6430d6
22 changed files with 61 additions and 32 deletions

View File

@@ -1926,7 +1926,8 @@ static inline bool isImmUs4(int64_t val)
/// by AM is legal for this target, for a load/store of the specified type.
bool
XCoreTargetLowering::isLegalAddressingMode(const AddrMode &AM,
Type *Ty) const {
Type *Ty,
unsigned AS) const {
if (Ty->getTypeID() == Type::VoidTyID)
return AM.Scale == 0 && isImmUs(AM.BaseOffs) && isImmUs4(AM.BaseOffs);

View File

@@ -120,7 +120,8 @@ namespace llvm {
EmitInstrWithCustomInserter(MachineInstr *MI,
MachineBasicBlock *MBB) const override;
bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;
bool isLegalAddressingMode(const AddrMode &AM, Type *Ty,
unsigned AS) const override;
private:
const TargetMachine &TM;