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

Unified Diff: src/IceTargetLowering.cpp

Issue 1368993004: Subzero: Improve usability of liveness-related tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 3 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/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 69207889b7e349b2a10a5561088f6699e1d431a3..eb4a54d4fb7ea915198113554503fa6178ba361b 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -246,17 +246,21 @@ void TargetLowering::regAlloc(RegAllocKind Kind) {
LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
}
-void TargetLowering::inferTwoAddress() {
- // Find two-address non-SSA instructions where Dest==Src0, and set the
- // DestNonKillable flag to keep liveness analysis consistent.
+void TargetLowering::markRedefinitions() {
+ // Find (non-SSA) instructions where the Dest variable appears in some source
+ // operand, and set the IsDestRedefined flag to keep liveness analysis
+ // consistent.
for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) {
if (Inst->isDeleted())
continue;
- if (Variable *Dest = Inst->getDest()) {
- // TODO(stichnot): We may need to consider all source operands, not just
- // the first one, if using 3-address instructions.
- if (Inst->getSrcSize() > 0 && Inst->getSrc(0) == Dest)
- Inst->setDestNonKillable();
+ Variable *Dest = Inst->getDest();
+ if (Dest == nullptr)
+ continue;
+ FOREACH_VAR_IN_INST(Var, *Inst) {
+ if (Var == Dest) {
+ Inst->setDestRedefined();
+ break;
+ }
}
}
}
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698