From db3bcc99105f45d56d244ea52792e937e8493583 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 12 Oct 2010 00:43:21 +0000 Subject: [PATCH] Handle a wider arrangement of loads. llvm-svn: 116284 --- llvm/lib/Target/ARM/ARMFastISel.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index d29b075ff8f1..9110e99d3bfc 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -588,6 +588,22 @@ bool ARMFastISel::ARMComputeRegOffset(const Value *Obj, unsigned &Reg, switch (Opcode) { default: break; + case Instruction::BitCast: { + // Look through bitcasts. + return ARMComputeRegOffset(U->getOperand(0), Reg, Offset); + } + case Instruction::IntToPtr: { + // Look past no-op inttoptrs. + if (TLI.getValueType(U->getOperand(0)->getType()) == TLI.getPointerTy()) + return ARMComputeRegOffset(U->getOperand(0), Reg, Offset); + break; + } + case Instruction::PtrToInt: { + // Look past no-op ptrtoints. + if (TLI.getValueType(U->getType()) == TLI.getPointerTy()) + return ARMComputeRegOffset(U->getOperand(0), Reg, Offset); + break; + } case Instruction::Alloca: { // Don't handle dynamic allocas. assert(!FuncInfo.StaticAllocaMap.count(cast(Obj)) && -- GitLab