Skip to content

Commit

Permalink
Refactor Binary Identity Simplification Macro
Browse files Browse the repository at this point in the history
This commit cleans up the BINARY_IDENTITY_OP and
BIANRY_IDENTITY_OR_ZERO macros and replaces them
with inline equivalents by implementing a struct to replace template
instantions of the functions tryAndSimplifyBinaryOp*.

This change limits the number of template instantiations
potential call sites have to create as well as abstracts
some captured variables inside the struct to minimize
the number of arguments passed to actual calls.

A closure is emulated by the struct.
Through escape analysis, scalar replacement and inlining,
the overhead of creating this struct should be minimal
on -O3

Related: #7166

Signed-off-by: James You <james.you@protonmail.com>
  • Loading branch information
jmesyou committed Mar 21, 2024
1 parent 622e8ea commit 5030f48
Show file tree
Hide file tree
Showing 2 changed files with 361 additions and 116 deletions.

0 comments on commit 5030f48

Please sign in to comment.