return MVT::INVALID_SIMPLE_VALUE_TYPE;
}
bool computeAddress(const Value *Obj, Address &Addr);
- bool materializeLoadStoreOperands(Address &Addr);
+ void materializeLoadStoreOperands(Address &Addr);
void addLoadStoreOperands(const Address &Addr, const MachineInstrBuilder &MIB,
MachineMemOperand *MMO);
unsigned maskI1Value(unsigned Reg, const Value *V);
} // end anonymous namespace
bool WebAssemblyFastISel::computeAddress(const Value *Obj, Address &Addr) {
-
const User *U = nullptr;
unsigned Opcode = Instruction::UserOp1;
if (const auto *I = dyn_cast<Instruction>(Obj)) {
return false;
if (const auto *GV = dyn_cast<GlobalValue>(Obj)) {
+ if (TLI.isPositionIndependent())
+ return false;
if (Addr.getGlobalValue())
return false;
Addr.setGlobalValue(GV);
return Addr.getReg() != 0;
}
-bool WebAssemblyFastISel::materializeLoadStoreOperands(Address &Addr) {
+void WebAssemblyFastISel::materializeLoadStoreOperands(Address &Addr) {
if (Addr.isRegBase()) {
unsigned Reg = Addr.getReg();
if (Reg == 0) {
- const GlobalValue *GV = Addr.getGlobalValue();
- if (GV && TLI.isPositionIndependent())
- return false;
Reg = createResultReg(Subtarget->hasAddr64() ? &WebAssembly::I64RegClass
: &WebAssembly::I32RegClass);
unsigned Opc = Subtarget->hasAddr64() ? WebAssembly::CONST_I64
Addr.setReg(Reg);
}
}
- return true;
}
void WebAssemblyFastISel::addLoadStoreOperands(const Address &Addr,
return false;
}
- if (!materializeLoadStoreOperands(Addr))
- return false;
+ materializeLoadStoreOperands(Addr);
unsigned ResultReg = createResultReg(RC);
auto MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc),
return false;
}
- if (!materializeLoadStoreOperands(Addr))
- return false;
+ materializeLoadStoreOperands(Addr);
unsigned ValueReg = getRegForValue(Store->getValueOperand());
if (ValueReg == 0)