[VectorCombine] switch on opcode to compile faster
authorSanjay Patel <spatel@rotateright.com>
Tue, 22 Nov 2022 14:28:55 +0000 (09:28 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 22 Nov 2022 15:23:32 +0000 (10:23 -0500)
commitede6d608f4a92ef508b91f0a37f5b9dc1de45f47
tree466aa93a1342f149963184a8aee5894e48dedd0a
parent8effceb570d924675cd4b15e6ca25311598797d1
[VectorCombine] switch on opcode to compile faster

This follows 87debdadaf18 to further eliminate wasting time
calling helper functions only to early return to the main
run loop.

Once again, this results in significant savings based on
experimental data:
https://llvm-compile-time-tracker.com/compare.php?from=01023bfcd33f922ed8c934ce563e54abe8bfe246&to=3dce4f70b73e48ccb045decb634c185e6b4c67d5&stat=instructions:u

This is NFCI other than making the pass faster. The total
cost of VectorCombine runs in an -O3 build appears to be
well under 0.1% of compile-time now, so there's not much
left to do AFAICT.

There's a TODO about making the code cleaner, but it
probably doesn't change timing much. I didn't include those
changes here because it requires updating much more code.
llvm/lib/Transforms/Vectorize/VectorCombine.cpp