[all-commits] [llvm/llvm-project] 0f7bbb: Always emit error for wrong interfaces to scalable...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Fri Apr 2 03:23:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f7bbbc481e20a152c74bc315f8995b62d54c8c0
      https://github.com/llvm/llvm-project/commit/0f7bbbc481e20a152c74bc315f8995b62d54c8c0
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2021-04-02 (Fri, 02 Apr 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M llvm/include/llvm/CodeGen/ValueTypes.h
    M llvm/include/llvm/Support/TypeSize.h
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/TypeSize.cpp
    M llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp

  Log Message:
  -----------
  Always emit error for wrong interfaces to scalable vectors, unless cmdline flag is passed.

In order to bring up scalable vector support in LLVM incrementally,
we introduced behaviour to emit a warning, instead of an error, when
asking the wrong question of a scalable vector, like asking for the
fixed number of elements.

This patch puts that behaviour under a flag. The default behaviour is
that the compiler will always error, which means that all LLVM unit
tests and regression tests will now fail when a code-path is taken that
still uses the wrong interface.

The behaviour to demote an error to a warning can be individually enabled
for tools that want to support experimental use of scalable vectors.
This patch enables that behaviour when driving compilation from Clang.
This means that for users who want to try out scalable-vector support,
fixed-width codegen support, or build user-code with scalable vector
intrinsics, Clang will not crash and burn when the compiler encounters
such a case.

This allows us to do away with the following pattern in many of the SVE tests:
  RUN: .... 2>%t
  RUN: cat %t | FileCheck --check-prefix=WARN
  WARN-NOT: warning: ...

The behaviour to emit warnings is only temporary and we expect this flag
to be removed in the future when scalable vector support is more stable.

This patch also has fixes the following tests:
 unittests:
   ScalableVectorMVTsTest.SizeQueries
   SelectionDAGAddressAnalysisTest.unknownSizeFrameObjects
   AArch64SelectionDAGTest.computeKnownBitsSVE_ZERO_EXTEND_VECTOR_INREG

 regression tests:
   Transforms/InstCombine/vscale_gep.ll

Reviewed By: paulwalker-arm, ctetreau

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




More information about the All-commits mailing list