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/IceOperand.h

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 | « src/IceLiveness.cpp ('k') | src/IceOperand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 327c348f6fb99a1f2d8c72d6f3137a55a5650073..d80bede0f7148032957a85eb64851b795f598756 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -661,7 +661,9 @@ public:
void setIsImplicitArg(bool Val = true) { IsImplicitArgument = Val; }
void setIgnoreLiveness() { IgnoreLiveness = true; }
- bool getIgnoreLiveness() const { return IgnoreLiveness; }
+ bool getIgnoreLiveness() const {
+ return IgnoreLiveness || IsRematerializable;
+ }
int32_t getStackOffset() const { return StackOffset; }
void setStackOffset(int32_t Offset) { StackOffset = Offset; }
@@ -863,8 +865,6 @@ using InstDefList = CfgVector<const Inst *>;
/// VariableTracking tracks the metadata for a single variable. It is
/// only meant to be used internally by VariablesMetadata.
class VariableTracking {
- VariableTracking &operator=(const VariableTracking &) = delete;
-
public:
enum MultiDefState {
// TODO(stichnot): Consider using just a simple counter.
@@ -873,9 +873,16 @@ public:
MDS_MultiDefSingleBlock,
MDS_MultiDefMultiBlock
};
- enum MultiBlockState { MBS_Unknown, MBS_SingleBlock, MBS_MultiBlock };
+ enum MultiBlockState {
+ MBS_Unknown, // Not yet initialized, so be conservative
+ MBS_NoUses, // Known to have no uses
+ MBS_SingleBlock, // All uses in are in a single block
+ MBS_MultiBlock // Several uses across several blocks
+ };
VariableTracking() = default;
VariableTracking(const VariableTracking &) = default;
+ VariableTracking &operator=(const VariableTracking &) = default;
+ VariableTracking(MultiBlockState MultiBlock) : MultiBlock(MultiBlock) {}
MultiDefState getMultiDef() const { return MultiDef; }
MultiBlockState getMultiBlock() const { return MultiBlock; }
const Inst *getFirstDefinitionSingleBlock() const;
@@ -948,6 +955,7 @@ public:
/// always considered multi-block because they are live coming into the entry
/// block.
bool isMultiBlock(const Variable *Var) const;
+ bool isSingleBlock(const Variable *Var) const;
/// Returns the node that the given Variable is used in, assuming
/// isMultiBlock() returns false. Otherwise, nullptr is returned.
CfgNode *getLocalUseNode(const Variable *Var) const;
« no previous file with comments | « src/IceLiveness.cpp ('k') | src/IceOperand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698