Index: src/IceTargetLoweringX8664.cpp |
diff --git a/src/IceTargetLoweringX8664.cpp b/src/IceTargetLoweringX8664.cpp |
index 5aaf2c9035ebc687e084f7c3ddec4acd43e980c3..8389ba80c79d33e162c1bd4edbc3abfbf59ad12f 100644 |
--- a/src/IceTargetLoweringX8664.cpp |
+++ b/src/IceTargetLoweringX8664.cpp |
@@ -36,6 +36,11 @@ createTargetHeaderLowering(::Ice::GlobalContext *Ctx) { |
void staticInit(::Ice::GlobalContext *Ctx) { |
::Ice::X8664::TargetX8664::staticInit(Ctx); |
} |
+ |
+bool shouldBePooled(const class ::Ice::Constant *C) { |
+ return ::Ice::X8664::TargetX8664::shouldBePooled(C); |
+} |
+ |
} // end of namespace X8664 |
namespace Ice { |
@@ -344,11 +349,9 @@ Traits::X86OperandMem *TargetX8664::_sandbox_mem_reference(X86OperandMem *Mem) { |
bool AbsoluteAddress = false; |
if (Base == nullptr && Index == nullptr) { |
- if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { |
- if (CR->getName() != "") { |
- // Mem is RIP-relative. There's no need to rebase it. |
- return Mem; |
- } |
+ if (llvm::isa<ConstantRelocatable>(Offset)) { |
+ // Mem is RIP-relative. There's no need to rebase it. |
+ return Mem; |
} |
// Offset is an absolute address, so we need to emit |
// Offset(%r15) |
@@ -411,7 +414,7 @@ Traits::X86OperandMem *TargetX8664::_sandbox_mem_reference(X86OperandMem *Mem) { |
bool NeedsLea = false; |
if (Offset != nullptr) { |
if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { |
- NeedsLea = CR->getName() != "" || CR->getOffset() < 0; |
+ NeedsLea = CR->getOffset() < 0; |
} else if (const auto *Imm = llvm::dyn_cast<ConstantInteger32>(Offset)) { |
NeedsLea = Imm->getValue() < 0; |
} else { |
@@ -626,9 +629,10 @@ Inst *TargetX8664::emitCallToTarget(Operand *CallTarget, Variable *ReturnReg) { |
auto *ReturnRelocOffset = RelocOffset::create(Func->getAssembler()); |
ReturnAddress->setRelocOffset(ReturnRelocOffset); |
constexpr RelocOffsetT NoFixedOffset = 0; |
- const IceString EmitString = ReturnAddress->getName(Func); |
+ const std::string EmitString = |
+ BuildDefs::dump() ? ReturnAddress->getLabelName().toString() : ""; |
auto *ReturnReloc = ConstantRelocatable::create( |
- Func->getAssembler(), IceType_i32, |
+ Func->getAssembler(), Ctx, IceType_i32, |
RelocatableTuple(NoFixedOffset, {ReturnRelocOffset}, |
Func->getFunctionName(), EmitString)); |
/* AutoBundle scoping */ { |