[all-commits] [llvm/llvm-project] 5b14f5: [CodeGen] Fix wrong use of getVectorNumElements in...

david-arm via All-commits all-commits at lists.llvm.org
Wed Jul 8 01:37:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b14f5051f134d29f51b523e5c9b602c08a4a7af
      https://github.com/llvm/llvm-project/commit/5b14f5051f134d29f51b523e5c9b602c08a4a7af
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2020-07-08 (Wed, 08 Jul 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

  Log Message:
  -----------
  [CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR

Calling getVectorNumElements() is not safe for scalable vectors and we
should normally use getVectorElementCount() instead. However, for the
code changed in this patch I decided to simply move the instantiation of
the variable 'OutNumElems' lower down to the place where only fixed-width
vectors are used, and hence it is safe to call getVectorNumElements().

Fixes up one warning in this test:

  sve-sext-zext.ll

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




More information about the All-commits mailing list