Class RewriteRemoveUnnecessaryCasts

  • public class RewriteRemoveUnnecessaryCasts
    extends HopRewriteRule
    Rule: RemoveUnnecessaryCasts. For all value type casts check if they are really necessary. If both cast input and output type are the same, the cast itself is redundant. There are two use case where this can arise: (1) automatically inserted casts on function inlining (in case of unknown value types), and (2) explicit script-level value type casts, that might be redundant according to the read input data. The benefit of this rewrite is negligible for scalars. However, when we support matrices with different value types, those casts might refer to matrices and with that incur large costs.
    • Constructor Detail

      • RewriteRemoveUnnecessaryCasts

        public RewriteRemoveUnnecessaryCasts()