[llvm] [LoopVectorize] LLVM fails to vectorise loops with multi-bool varables (PR #89226)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 07:03:04 PDT 2024


================
@@ -270,6 +275,8 @@ class RecurrenceDescriptor {
            cast<IntrinsicInst>(I)->getIntrinsicID() == Intrinsic::fmuladd;
   }
 
+  Instruction *getMultiCmp() const { return MultiCmp; }
----------------
david-arm wrote:

I must admit I haven't looked through all the code yet, but I'm a bit confused about why we need this? It looks like you're jumping on the back of the IAnyOf and FAnyOf RecurKind types, which by definition include a cmp instruction. The only difference here is that you are permitting multiple uses of that same cmp instruction.

Can you not simply obtain the cmp instruction from the IV descriptor itself? It just feels a bit strange to add `Instruction *MultiCmp` variable here because it doesn't make sense for any other RecurKinds. I guess what you are trying to do is add a different flavour of IAnyOf, FAnyOf without having to create a new RecurKind.

https://github.com/llvm/llvm-project/pull/89226


More information about the llvm-commits mailing list