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

Unified Diff: src/compiler/instruction-scheduler.h

Issue 2376963002: [turbofan] Relax dependencies due to deopt during instruction scheduling. (Closed)
Patch Set: fix formatting (git cl format) Created 4 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/compiler/ia32/instruction-scheduler-ia32.cc ('k') | src/compiler/instruction-scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-scheduler.h
diff --git a/src/compiler/instruction-scheduler.h b/src/compiler/instruction-scheduler.h
index 7bde16a94a4b7a7f9951391c4ce7297ee30a7948..7660520b6d817815336bb88b96a591c3eb619b3b 100644
--- a/src/compiler/instruction-scheduler.h
+++ b/src/compiler/instruction-scheduler.h
@@ -21,9 +21,12 @@ enum ArchOpcodeFlags {
kHasSideEffect = 2, // The instruction has some side effects (memory
// store, function call...)
kIsLoadOperation = 4, // The instruction is a memory load.
+ kMayNeedDeoptCheck = 8, // The instruction might be associated with a deopt
+ // check. This is the case of instruction which can
+ // blow up with particular inputs (e.g.: division by
+ // zero on Intel platforms).
};
-
class InstructionScheduler final : public ZoneObject {
public:
InstructionScheduler(Zone* zone, InstructionSequence* sequence);
@@ -155,12 +158,25 @@ class InstructionScheduler final : public ZoneObject {
// Check whether the given instruction has side effects (e.g. function call,
// memory store).
bool HasSideEffect(const Instruction* instr) const {
- return GetInstructionFlags(instr) & kHasSideEffect;
+ return (GetInstructionFlags(instr) & kHasSideEffect) != 0;
}
// Return true if the instruction is a memory load.
bool IsLoadOperation(const Instruction* instr) const {
- return GetInstructionFlags(instr) & kIsLoadOperation;
+ return (GetInstructionFlags(instr) & kIsLoadOperation) != 0;
+ }
+
+ // Return true if this instruction is usually associated with a deopt check
+ // to validate its input.
+ bool MayNeedDeoptCheck(const Instruction* instr) const {
+ return (GetInstructionFlags(instr) & kMayNeedDeoptCheck) != 0;
+ }
+
+ // Return true if the instruction cannot be moved before the last deopt
+ // point we encountered.
+ bool DependsOnDeoptimization(const Instruction* instr) const {
+ return MayNeedDeoptCheck(instr) || instr->IsDeoptimizeCall() ||
+ HasSideEffect(instr) || IsLoadOperation(instr);
}
// Identify nops used as a definition point for live-in registers at
« no previous file with comments | « src/compiler/ia32/instruction-scheduler-ia32.cc ('k') | src/compiler/instruction-scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698