com.arm.carp.apps.optimizer.passes

DeadCodeElimination

object DeadCodeElimination extends Pass

Remove unreachable (dead) and useless code from PENCIL program.

The following is considered dead code: - if statement with empty body and else-body and side effect free guard - while statement with empty body and side effect free guard - empty block statement - assignment statement with side effect free lvalue and rvalue expressions, which doesn't reach any other expression - if (const) {...} statements if (false) {A;}else{B;} is transformed into {B;} if (true) {A;}else{B;} is transformed into {A;} - while (false) {...} statements - for loop with empty body - Statements after return in the same block

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DeadCodeElimination
  2. Pass
  3. Walker
  4. ExpressionWalker
  5. CommonOps
  6. Assertable
  7. Common
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Annotated[T] = (T, Option[Operation])

    Definition Classes
    ExpressionWalker
  2. type AnnotatedArrayExpression = (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  3. type AnnotatedScalarExpression = (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def assert(cond: Boolean, data: Any, message: String): Unit

    Check the condition and calls Assertable.ice if condition is false.

    Check the condition and calls Assertable.ice if condition is false.

    cond

    condition to check

    data

    additional data to include in error message

    message

    error message

    Definition Classes
    Assertable
  8. val called: Set[Function]

  9. var changed: Boolean

    Definition Classes
    Pass
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def compatibleFunctions(f1: Function, f2: Function): Boolean

    Definition Classes
    Common
  12. def compatibleWithFunction(f1: Function, retType: ScalarType, params: Seq[Variable]): Boolean

    Definition Classes
    Common
  13. val config: WalkerConfigStorage

    Definition Classes
    DeadCodeEliminationWalker
  14. def convertScalar(exp: ScalarExpression, _type: ScalarType): ScalarExpression

    Definition Classes
    Common
  15. def doNothing(): Unit

    Default action for leaf processing.

    Default action for leaf processing. Can be overridden to call ICE (to ensure that all processing is implemented by pass).

    Definition Classes
    Walker
  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. def getArgsTemplate: PassArgumentStorage

    Definition Classes
    Pass
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def getCleanBody(in: Option[BlockOperation]): BlockOperation

    Definition Classes
    Walker
  22. def getMaxType(t1: ScalarType, t2: ScalarType): ScalarType

    Definition Classes
    Common
  23. def getScalarType(in: Type): ScalarType

    Definition Classes
    Common
  24. def getScalarZero(in: ScalarType): ScalarExpression

    Definition Classes
    Common
  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. def ice(data: Any, message: String): Nothing

    Report internal compilation error and throw RuntimeException.

    Report internal compilation error and throw RuntimeException.

    data

    additional data to include in error message

    message

    error message

    Definition Classes
    Assertable
  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. def listFromSumTree(in: ScalarExpression): List[ScalarExpression]

    Construct a list of terms from a summation/subtraction expression tree.

    Construct a list of terms from a summation/subtraction expression tree.

    Definition Classes
    Common
  29. def make(init: Option[Operation]*): Option[Operation]

    Definition Classes
    CommonOps
  30. def makeBlock(init: Option[Operation]*): Option[BlockOperation]

    Definition Classes
    CommonOps
  31. val name: String

    Definition Classes
    Pass
  32. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  35. def registerOption[T](oname: String, default: T): () ⇒ T

    Definition Classes
    Pass
  36. def rerun: Boolean

    Definition Classes
    Pass
  37. def reset_changed(): Unit

    Definition Classes
    Pass
  38. final def run(in: Program, pargs: PassArgumentStorage): Program

    Definition Classes
    Pass
  39. def set_changed(): Unit

    Definition Classes
    Pass
  40. def sumTreeFromList(terms: List[ScalarExpression]): ScalarExpression

    Construct a summation tree from a list of expressions.

    Construct a summation tree from a list of expressions.

    Definition Classes
    Common
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  42. def toString(): String

    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  46. def walkAccessFunction(in: Option[Function]): Unit

    Definition Classes
    Walker
  47. def walkArrayConstant(in: ArrayConstant): (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  48. def walkArrayDeclOperation(in: ArrayDeclOperation): Option[Operation]

    Definition Classes
    Walker
  49. def walkArrayExpression(in: ArrayExpression): (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  50. def walkArrayIdxExpression(in: ArrayIdxExpression): (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  51. def walkArrayStructSubscription(in: ArrayStructSubscription): (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  52. def walkArrayType(in: ArrayType): Option[Operation]

    Definition Classes
    Walker
  53. def walkArrayVariable(in: ArrayVariableRef): (ArrayExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  54. def walkArrayVariableInt(in: ArrayVariable): (ArrayExpression, Option[Operation])

    All raw variables must be eliminated before leaving the front-end.

    All raw variables must be eliminated before leaving the front-end.

    Definition Classes
    ExpressionWalker
  55. def walkAssignment(in: AssignmentOperation): Option[Operation]

    Definition Classes
    DeadCodeEliminationWalker
  56. def walkBlock(in: BlockOperation): Option[BlockOperation]

    Definition Classes
    DeadCodeEliminationWalker
  57. def walkBlock(in: Option[BlockOperation]): Option[BlockOperation]

    Definition Classes
    Walker
  58. def walkBreak(in: BreakOperation): Option[Operation]

    Definition Classes
    Walker
  59. def walkCallExpression(in: CallExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    DeadCodeEliminationExpressionWalker
  60. def walkCallOp(in: CallOperation): Option[Operation]

    Definition Classes
    Walker
  61. def walkContinue(in: ContinueOperation): Option[Operation]

    Definition Classes
    Walker
  62. def walkConvertExpression(in: ConvertExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  63. def walkExpression(in: Expression): (Expression, Option[Operation])

    Definition Classes
    ExpressionWalker
  64. def walkExpressionProxy(in: Expression): (Expression, Option[Operation])

    Definition Classes
    Walker
  65. def walkFor(in: ForOperation): Option[Operation]

    Definition Classes
    DeadCodeEliminationWalker
  66. def walkFunction(f: Function): Option[Function]

    Definition Classes
    Walker
  67. def walkFunctionArgument(in: Variable): Variable

    Definition Classes
    Walker
  68. def walkFunctionArguments(in: Seq[Variable]): Seq[Variable]

    Definition Classes
    Walker
  69. def walkFunctionBody(in: Option[BlockOperation]): Option[BlockOperation]

    Definition Classes
    Walker
  70. def walkFunctions(in: Traversable[Function]): Traversable[Function]

    Definition Classes
    DeadCodeEliminationWalker
  71. def walkGlobalConst(c: Variable): Some[Variable]

    Definition Classes
    Walker
  72. def walkGlobalConsts(in: Seq[Variable]): Seq[Variable]

    Definition Classes
    Walker
  73. def walkGlobalType(t: StructType): Some[StructType]

    Definition Classes
    Walker
  74. def walkGlobalTypes(in: Seq[StructType]): Seq[StructType]

    Definition Classes
    Walker
  75. def walkGuardExpression(in: ScalarExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    Walker
  76. def walkIf(in: IfOperation): Option[Operation]

    Definition Classes
    DeadCodeEliminationWalker
  77. def walkIntrinsicCallExpression(in: IntrinsicCallExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  78. def walkIterationVariable(in: ScalarVariableRef): (ScalarVariableRef, Option[Operation])

    Definition Classes
    ExpressionWalker
  79. def walkLValueExpression(in: ScalarExpression with LValue): (ScalarExpression with LValue, Option[Operation])

    Definition Classes
    Walker
  80. def walkOperation(in: Operation): Option[Operation]

    Definition Classes
    Walker
  81. def walkPENCILOperation(in: Operation with PENCILOperation): Option[Operation]

    Definition Classes
    Walker
  82. def walkProgram(in: Program): Program

    Definition Classes
    DeadCodeEliminationWalker
  83. def walkRange(in: Range): (Range, Option[Operation])

    Definition Classes
    Walker
  84. def walkReturn(in: ReturnOperation): Option[Operation]

    Definition Classes
    Walker
  85. def walkScalarBinaryExpression(in: ScalarBinaryExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  86. def walkScalarConstant(in: Constant with ScalarExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  87. def walkScalarExpression(in: ScalarExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  88. def walkScalarExpressionProxy(in: ScalarExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    Walker
  89. def walkScalarIdxExpression(in: ScalarIdxExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  90. def walkScalarStructSubscription(in: ScalarStructSubscription): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  91. def walkScalarTernaryExpression(in: TernaryExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  92. def walkScalarUnaryExpression(in: ScalarUnaryExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  93. def walkScalarVariable(in: ScalarVariableRef): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  94. def walkScalarVariableInt(in: ScalarVariable): (ScalarExpression, Option[Operation])

    All raw variables must be eliminated before leaving the front-end.

    All raw variables must be eliminated before leaving the front-end.

    Definition Classes
    ExpressionWalker
  95. def walkSizeofExpression(in: SizeofExpression): (ScalarExpression, Option[Operation])

    Definition Classes
    ExpressionWalker
  96. def walkWhile(in: WhileOperation): Option[Operation]

    Definition Classes
    DeadCodeEliminationWalker

Inherited from Pass

Inherited from Walker

Inherited from ExpressionWalker

Inherited from CommonOps

Inherited from Assertable

Inherited from Common

Inherited from AnyRef

Inherited from Any

Ungrouped