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

Unified Diff: src/IceInst.h

Issue 1506653002: Subzero: Add Non-SFI support for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 12 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/IceGlobalContext.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.h
diff --git a/src/IceInst.h b/src/IceInst.h
index f9265f6920ebc68c7fa7d097ec0165359454ab73..f8ca48c5deb5e953b4173ba92f640d243e7831fd 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -854,15 +854,18 @@ private:
/// FakeUse instruction. This creates a fake use of a variable, to keep the
/// instruction that produces that variable from being dead-code eliminated.
/// This is useful in a variety of lowering situations. The FakeUse instruction
-/// has no dest, so it can itself never be dead-code eliminated.
+/// has no dest, so it can itself never be dead-code eliminated. A weight can
+/// be provided to provide extra bias to the register allocator - for simplicity
+/// of implementation, weight=N is handled by holding N copies of the variable
+/// as source operands.
class InstFakeUse : public InstHighLevel {
InstFakeUse() = delete;
InstFakeUse(const InstFakeUse &) = delete;
InstFakeUse &operator=(const InstFakeUse &) = delete;
public:
- static InstFakeUse *create(Cfg *Func, Variable *Src) {
- return new (Func->allocate<InstFakeUse>()) InstFakeUse(Func, Src);
+ static InstFakeUse *create(Cfg *Func, Variable *Src, uint32_t Weight = 1) {
+ return new (Func->allocate<InstFakeUse>()) InstFakeUse(Func, Src, Weight);
}
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg * /* Func */) const override {}
@@ -870,7 +873,7 @@ public:
static bool classof(const Inst *Inst) { return Inst->getKind() == FakeUse; }
private:
- InstFakeUse(Cfg *Func, Variable *Src);
+ InstFakeUse(Cfg *Func, Variable *Src, uint32_t Weight);
};
/// FakeKill instruction. This "kills" a set of variables by modeling a trivial
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698