From df1f5a924e89fc2f744681677ca03c68aae5bc34 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 7 Oct 2010 21:40:18 +0000 Subject: [PATCH] Remember to promote load/store types for stack to register size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115984 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMFastISel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index 497259c4071..05209aa2f19 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -629,6 +629,9 @@ bool ARMFastISel::ARMComputeRegOffset(const Value *Obj, unsigned &Reg, bool ARMFastISel::ARMLoadAlloca(const Instruction *I, EVT VT) { Value *Op0 = I->getOperand(0); + // Promote load/store types. + if (VT == MVT::i8 || VT == MVT::i16) VT = MVT::i32; + // Verify it's an alloca. if (const AllocaInst *AI = dyn_cast(Op0)) { DenseMap::iterator SI = @@ -735,6 +738,9 @@ bool ARMFastISel::SelectLoad(const Instruction *I) { bool ARMFastISel::ARMStoreAlloca(const Instruction *I, unsigned SrcReg, EVT VT){ Value *Op1 = I->getOperand(1); + // Promote load/store types. + if (VT == MVT::i8 || VT == MVT::i16) VT = MVT::i32; + // Verify it's an alloca. if (const AllocaInst *AI = dyn_cast(Op1)) { DenseMap::iterator SI = -- 2.34.1