[all-commits] [llvm/llvm-project] 1c7c69: [ValueTracking] Check for ConstantExpr before usin...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Jul 24 09:38:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c7c69c795b22d73d038dd9b49de921cfd9d3468
      https://github.com/llvm/llvm-project/commit/1c7c69c795b22d73d038dd9b49de921cfd9d3468
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-07-24 (Fri, 24 Jul 2020)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    A llvm/test/Transforms/GVN/constexpr-vector-constainsundef-crash.ll

  Log Message:
  -----------
  [ValueTracking] Check for ConstantExpr before using recursive helpers.

Make sure we do not call
constainsConstantExpression/containsUndefElement on ConstantExpression,
which is not supported.

In particular, containsUndefElement/constainsConstantExpression are only
supported on constants which are supported by getAggregateElement.

Unfortunately there's no convenient way to check if a constant supports
getAggregateElement, so just check for non-constantexpressions with
vector type. Other users of those functions do so too.

Reviewers: spatel, nikic, craig.topper, lebedev.ri, jdoerfert, aqjune

Reviewed By: jdoerfert

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




More information about the All-commits mailing list