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

Unified Diff: src/IceInst.cpp

Issue 1844713004: Subzero: Ignore variables with no actual uses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Also ignore rematerializable variables 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 | « no previous file | src/IceLiveness.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 5a308d89eece5721e2c1ac0eef40f4f372946ec4..f6e8974fa1d1382dca082fe83b93bf50c1e0130f 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -206,7 +206,7 @@ bool Inst::liveness(InstNumberT InstNumber, LivenessBV &Live,
assert(!isDeleted());
Dead = false;
- if (Dest) {
+ if (Dest && !Dest->isRematerializable()) {
SizeT VarNum = Liveness->getLiveIndex(Dest->getIndex());
if (Live[VarNum]) {
if (!isDestRedefined()) {
@@ -227,6 +227,8 @@ bool Inst::liveness(InstNumberT InstNumber, LivenessBV &Live,
bool IsPhi = llvm::isa<InstPhi>(this);
resetLastUses();
FOREACH_VAR_IN_INST(Var, *this) {
+ if (Var->isRematerializable())
+ continue;
SizeT VarNum = Liveness->getLiveIndex(Var->getIndex());
if (!Live[VarNum]) {
setLastUse(IndexOfVarInInst(Var));
@@ -411,10 +413,12 @@ void InstPhi::livenessPhiOperand(LivenessBV &Live, CfgNode *Target,
for (SizeT I = 0; I < getSrcSize(); ++I) {
if (Labels[I] == Target) {
if (auto *Var = llvm::dyn_cast<Variable>(getSrc(I))) {
- SizeT SrcIndex = Liveness->getLiveIndex(Var->getIndex());
- if (!Live[SrcIndex]) {
- setLastUse(I);
- Live[SrcIndex] = true;
+ if (!Var->isRematerializable()) {
+ SizeT SrcIndex = Liveness->getLiveIndex(Var->getIndex());
+ if (!Live[SrcIndex]) {
+ setLastUse(I);
+ Live[SrcIndex] = true;
+ }
}
}
return;
« no previous file with comments | « no previous file | src/IceLiveness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698