[all-commits] [llvm/llvm-project] 5b250a: [Analysis][LoopVectorize] do not form reductions o...

RotateRight via All-commits all-commits at lists.llvm.org
Fri Feb 19 11:03:59 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b250a27ec7822aa0a32abb696cb16c2cc60149c
      https://github.com/llvm/llvm-project/commit/5b250a27ec7822aa0a32abb696cb16c2cc60149c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    M llvm/lib/Analysis/IVDescriptors.cpp
    A llvm/test/Transforms/LoopVectorize/reduction-ptr.ll

  Log Message:
  -----------
  [Analysis][LoopVectorize] do not form reductions of pointers

This is a fix for https://llvm.org/PR49215 either before/after
we make a verifier enhancement for vector reductions with D96904.

I'm not sure what the current thinking is for pointer math/logic
in IR. We allow icmp on pointer values. Therefore, we match min/max
patterns, so without this patch, the vectorizer could form a vector
reduction from that sequence.

But the LangRef definitions for min/max and vector reduction
intrinsics do not allow pointer types:
https://llvm.org/docs/LangRef.html#llvm-smax-intrinsic
https://llvm.org/docs/LangRef.html#llvm-vector-reduce-umax-intrinsic

So we would crash/assert at some point - either in IR verification,
in the cost model, or in codegen. If we do want to allow this kind
of transform, we will need to update the LangRef and all of those
parts of the compiler.

Differential Revision: https://reviews.llvm.org/D97047




More information about the All-commits mailing list