[pseudo] Turn glrReduce into a class, reuse storage across calls.
authorSam McCall <sam.mccall@gmail.com>
Tue, 21 Jun 2022 20:19:06 +0000 (22:19 +0200)
committerSam McCall <sam.mccall@gmail.com>
Thu, 23 Jun 2022 17:27:47 +0000 (19:27 +0200)
commit3e610f2cdc1e156c82f5b59c287165e769b24f40
tree1e0154258027d222d2b15ba9cb00ce33db8e2946
parent1cc97922811a27c2cd8fd88a1367f29f3d64487a
[pseudo] Turn glrReduce into a class, reuse storage across calls.

This is a ~5% speedup, we no longer have to allocate the priority queues and
other collections for each reduction step where we use them.

It's also IMO easier to understand the structure of a class with methods vs a
function with nested lambdas.

Differential Revision: https://reviews.llvm.org/D128301
clang-tools-extra/pseudo/lib/GLR.cpp