[llvm] [LoopIdiomVectorize] Recognize and transform minidx pattern (PR #144987)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 03:17:02 PDT 2025
nikic wrote:
@madhur13490 I think this needs to happen in two steps. The first thing you want is to get rid of the sext + trunc in Minlst IV, as these complicate the pattern. Something along these lines: https://llvm.godbolt.org/z/6co5q3Wrn I'm not really sure how to best formulate this, but in principle something like this could fit in InstCombine.
I think it would be better to focus on this simplified case for now, so we don't get lost in uninteresting sext/trunc details: https://llvm.godbolt.org/z/Gc9n3qx47
In that form, I think the pattern is a lot more straightforward, and I feel like it should be possible to extend GVN load PRE to handle it. GVN / MDA already support select dependences for the general load of select pattern. I think what is missing here is handling this case of a phi-translated selected.
https://github.com/llvm/llvm-project/pull/144987
More information about the llvm-commits
mailing list