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

RotateRight via All-commits all-commits at lists.llvm.org
Mon Feb 22 11:40:44 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a3545a0b0777da773c5e2370622579c44a8f0f63
      https://github.com/llvm/llvm-project/commit/a3545a0b0777da773c5e2370622579c44a8f0f63
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-02-22 (Mon, 22 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

(cherry picked from commit 5b250a27ec7822aa0a32abb696cb16c2cc60149c)




More information about the All-commits mailing list