comparison lib/Target/Mips/MipsFastISel.cpp @ 100:7d135dc70f03 LLVM 3.9

LLVM 3.9
author Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 22:53:40 +0900
parents afa8332a0e37
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
96:6418606d0ead 100:7d135dc70f03
190 : FastISel(funcInfo, libInfo), TM(funcInfo.MF->getTarget()), 190 : FastISel(funcInfo, libInfo), TM(funcInfo.MF->getTarget()),
191 Subtarget(&funcInfo.MF->getSubtarget<MipsSubtarget>()), 191 Subtarget(&funcInfo.MF->getSubtarget<MipsSubtarget>()),
192 TII(*Subtarget->getInstrInfo()), TLI(*Subtarget->getTargetLowering()) { 192 TII(*Subtarget->getInstrInfo()), TLI(*Subtarget->getTargetLowering()) {
193 MFI = funcInfo.MF->getInfo<MipsFunctionInfo>(); 193 MFI = funcInfo.MF->getInfo<MipsFunctionInfo>();
194 Context = &funcInfo.Fn->getContext(); 194 Context = &funcInfo.Fn->getContext();
195 bool ISASupported = !Subtarget->hasMips32r6() && Subtarget->hasMips32();
195 TargetSupported = 196 TargetSupported =
196 ((TM.getRelocationModel() == Reloc::PIC_) && 197 ISASupported && (TM.getRelocationModel() == Reloc::PIC_) &&
197 ((Subtarget->hasMips32r2() || Subtarget->hasMips32()) && 198 (static_cast<const MipsTargetMachine &>(TM).getABI().IsO32());
198 (static_cast<const MipsTargetMachine &>(TM).getABI().IsO32())));
199 UnsupportedFPMode = Subtarget->isFP64bit(); 199 UnsupportedFPMode = Subtarget->isFP64bit();
200 } 200 }
201 201
202 unsigned fastMaterializeAlloca(const AllocaInst *AI) override; 202 unsigned fastMaterializeAlloca(const AllocaInst *AI) override;
203 unsigned fastMaterializeConstant(const Constant *C) override; 203 unsigned fastMaterializeConstant(const Constant *C) override;
1178 // Need to store on the stack. 1178 // Need to store on the stack.
1179 // FIXME: This alignment is incorrect but this path is disabled 1179 // FIXME: This alignment is incorrect but this path is disabled
1180 // for now (will return false). We need to determine the right alignment 1180 // for now (will return false). We need to determine the right alignment
1181 // based on the normal alignment for the underlying machine type. 1181 // based on the normal alignment for the underlying machine type.
1182 // 1182 //
1183 unsigned ArgSize = RoundUpToAlignment(ArgVT.getSizeInBits(), 4); 1183 unsigned ArgSize = alignTo(ArgVT.getSizeInBits(), 4);
1184 1184
1185 unsigned BEAlign = 0; 1185 unsigned BEAlign = 0;
1186 if (ArgSize < 8 && !Subtarget->isLittle()) 1186 if (ArgSize < 8 && !Subtarget->isLittle())
1187 BEAlign = 8 - ArgSize; 1187 BEAlign = 8 - ArgSize;
1188 1188