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

Unified Diff: src/IceOperand.cpp

Issue 1738443002: Subzero. Performance tweaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments -- all of them Created 4 years, 10 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/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 73b0958e8699494e31c15f22a616225df7a7db11..27dc6a34ffe69c0c7eabd618025268245ce9eba5 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -19,6 +19,7 @@
#include "IceCfgNode.h"
#include "IceInst.h"
#include "IceInstVarIter.h"
+#include "IceMemory.h"
#include "IceTargetLowering.h" // dumping stack/frame pointer register
namespace Ice {
@@ -40,8 +41,8 @@ bool operator==(const RelocatableTuple &A, const RelocatableTuple &B) {
}
bool BothHaveKnownOffsets = true;
- RelocOffsetT OffsetA = 0;
- RelocOffsetT OffsetB = 0;
+ RelocOffsetT OffsetA = A.Offset;
+ RelocOffsetT OffsetB = B.Offset;
for (SizeT i = 0; i < A.OffsetExpr.size() && BothHaveKnownOffsets; ++i) {
BothHaveKnownOffsets = A.OffsetExpr[i]->hasOffset();
if (BothHaveKnownOffsets) {
@@ -197,7 +198,8 @@ const Variable *Variable::asType(Type Ty, RegNumT NewRegNum) const {
// Variable.
if (!BuildDefs::dump() || getType() == Ty)
return this;
- Variable *V = new (getCurrentCfgAllocator()->Allocate<Variable>())
+ static constexpr SizeT One = 1;
+ Variable *V = new (CfgLocalAllocator<Variable>().allocate(One))
Variable(kVariable, Ty, Number);
V->NameIndex = NameIndex;
V->RegNum = NewRegNum.hasValue() ? NewRegNum : RegNum;
« no previous file with comments | « src/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698