Ticket #268 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

optimise away redundant None and type checks

Reported by: scoder Owned by: scoder
Priority: minor Milestone: 0.13
Component: Code Generation Keywords:
Cc:

Description

After implementing #233 and fixing #166, the syntax tree ends up with a couple of redundant None checks where method calls were optimised. The C compiler might be able to remove them in many cases, but there should still be a separate pass that removes the redundant checks right before the code generation phase.

Change History

Changed 3 years ago by scoder

  • owner changed from somebody to scoder
  • status changed from new to assigned

Cython 0.13 has a new generic method ExprNode.as_none_safe_node() that injects a NoneCheckNode only when it is required (e.g. not for literals). This can be extended to include value ranges found by a future control flow analysis step. For now, it avoids truly redundant checks effectively.

Changed 3 years ago by scoder

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from wishlist to 0.13
Note: See TracTickets for help on using tickets.