C++/C#: add NonPhiMemoryOperand union type

This fixes a performance issue where the whole MemoryOperand table was
scanned in some predicates that used only NonPhiMemoryOperand
This commit is contained in:
Robert Marsh
2021-01-25 17:02:26 -08:00
parent 5d2a553059
commit 44bc6d7fdb
7 changed files with 12 additions and 5 deletions

View File

@@ -272,7 +272,7 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
/**
* A memory operand other than the operand of a `Phi` instruction.
*/
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
NonPhiMemoryOperand() {

View File

@@ -100,6 +100,8 @@ module RawOperands {
class TChiOperand = Internal::TNoOperand;
class TNonPhiMemoryOperand = TNonSSAMemoryOperand or TChiOperand;
/**
* Returns the Phi operand with the specified parameters.
*/
@@ -129,6 +131,7 @@ module UnaliasedSSAOperands {
class TChiOperand = Internal::TNoOperand;
class TNonPhiMemoryOperand = TNonSSAMemoryOperand or TChiOperand;
/**
* Returns the Phi operand with the specified parameters.
*/
@@ -158,6 +161,7 @@ module AliasedSSAOperands {
class TChiOperand = Internal::TAliasedChiOperand;
class TNonPhiMemoryOperand = TNonSSAMemoryOperand or TChiOperand;
/**
* Returns the Phi operand with the specified parameters.
*/

View File

@@ -272,7 +272,7 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
/**
* A memory operand other than the operand of a `Phi` instruction.
*/
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
NonPhiMemoryOperand() {

View File

@@ -272,7 +272,7 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
/**
* A memory operand other than the operand of a `Phi` instruction.
*/
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
NonPhiMemoryOperand() {

View File

@@ -80,6 +80,7 @@ module RawOperands {
class TChiOperand = Internal::TNoOperand;
class TNonPhiMemoryOperand = TNonSSAMemoryOperand or TChiOperand;
/**
* Returns the Phi operand with the specified parameters.
*/
@@ -109,6 +110,8 @@ module UnaliasedSSAOperands {
class TChiOperand = Internal::TNoOperand;
class TNonPhiMemoryOperand = TNonSSAMemoryOperand or TChiOperand;
/**
* Returns the Phi operand with the specified parameters.
*/

View File

@@ -272,7 +272,7 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
/**
* A memory operand other than the operand of a `Phi` instruction.
*/
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
NonPhiMemoryOperand() {

View File

@@ -272,7 +272,7 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
/**
* A memory operand other than the operand of a `Phi` instruction.
*/
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
NonPhiMemoryOperand() {