Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/IceTargetLoweringX8664.cpp

Issue 1838753002: Subzero: Remove IceString. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More cleanup Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 */ {
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698