[all-commits] [llvm/llvm-project] dcc410: [LoopVectorize] Fix crash on "getNoopOrZeroExtend ...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Mon Mar 30 10:14:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dcc410b5cf202e354105df431fad62d2f5f7eac7
      https://github.com/llvm/llvm-project/commit/dcc410b5cf202e354105df431fad62d2f5f7eac7
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/pr45259.ll

  Log Message:
  -----------
  [LoopVectorize] Fix crash on "getNoopOrZeroExtend cannot truncate!" (PR45259)

In InnerLoopVectorizer::getOrCreateTripCount, when the backedge taken
count is a SCEV add expression, its type is defined by the type of the
last operand of the add expression.

In the test case from PR45259, this last operand happens to be a
pointer, which (according to llvm::Type) does not have a primitive size
in bits. In this case, LoopVectorize fails to truncate the SCEV and
crashes as a result.

Uing ScalarEvolution::getTypeSizeInBits makes the truncation work as expected.

https://bugs.llvm.org/show_bug.cgi?id=45259

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




More information about the All-commits mailing list