Hacker News new | ask | show | jobs
by chrislattner 865 days ago
LLVM has an autovectorizer which is quite good, but such tech is limited because (eg) it can't change memory layout.

Speaking as someone who has spent more than 20 years writing compilers (e.g. LLVM, MLIR, etc), my opinion is that autovectorizers are a class of tech that are best applied to get speedups on legacy code bases. If you care about performance a lot, you shouldn't use them IMO - they are unpredictable and have performance cliffs.

-Chris

1 comments

Is the Mojo compiler restricted from changing the memory layout for some semantic reason or is it just llvm missing functionality? I know for other languages the semantics tends to be a major hinderance. IIRC your PhD thesis was about this stuff!

Regardless, the code in this post seems to use the same input in both versions and the change looks loop local at first blush, but maybe I'm missing something.