Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | if (Ty->getAddressSpace() > 255) | ||||
// address spaces. | // address spaces. | ||||
return false; | return false; | ||||
if (const auto *GV = dyn_cast<GlobalValue>(Obj)) { | if (const auto *GV = dyn_cast<GlobalValue>(Obj)) { | ||||
if (TLI.isPositionIndependent()) | if (TLI.isPositionIndependent()) | ||||
return false; | return false; | ||||
if (Addr.getGlobalValue()) | if (Addr.getGlobalValue()) | ||||
return false; | return false; | ||||
if (GV->isThreadLocal()) | |||||
return false; | |||||
Addr.setGlobalValue(GV); | Addr.setGlobalValue(GV); | ||||
return true; | return true; | ||||
} | } | ||||
switch (Opcode) { | switch (Opcode) { | ||||
default: | default: | ||||
break; | break; | ||||
case Instruction::BitCast: { | case Instruction::BitCast: { | ||||
▲ Show 20 Lines • Show All 365 Lines • ▼ Show 20 Lines | unsigned WebAssemblyFastISel::fastMaterializeAlloca(const AllocaInst *AI) { | ||||
return 0; | return 0; | ||||
} | } | ||||
unsigned WebAssemblyFastISel::fastMaterializeConstant(const Constant *C) { | unsigned WebAssemblyFastISel::fastMaterializeConstant(const Constant *C) { | ||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(C)) { | if (const GlobalValue *GV = dyn_cast<GlobalValue>(C)) { | ||||
if (TLI.isPositionIndependent()) | if (TLI.isPositionIndependent()) | ||||
return 0; | return 0; | ||||
if (GV->isThreadLocal()) | |||||
return 0; | |||||
unsigned ResultReg = | unsigned ResultReg = | ||||
createResultReg(Subtarget->hasAddr64() ? &WebAssembly::I64RegClass | createResultReg(Subtarget->hasAddr64() ? &WebAssembly::I64RegClass | ||||
: &WebAssembly::I32RegClass); | : &WebAssembly::I32RegClass); | ||||
unsigned Opc = Subtarget->hasAddr64() ? WebAssembly::CONST_I64 | unsigned Opc = Subtarget->hasAddr64() ? WebAssembly::CONST_I64 | ||||
: WebAssembly::CONST_I32; | : WebAssembly::CONST_I32; | ||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg) | BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg) | ||||
.addGlobalAddress(GV); | .addGlobalAddress(GV); | ||||
return ResultReg; | return ResultReg; | ||||
▲ Show 20 Lines • Show All 789 Lines • Show Last 20 Lines |