[llvm] 205085d - [CodeGen] Fix warnings in LowerToPredicatedOp

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 07:19:18 PDT 2020


Author: David Sherwood
Date: 2020-05-29T15:19:03+01:00
New Revision: 205085d4ccf9c367ba70de9d8f0dd74d6f567c24

URL: https://github.com/llvm/llvm-project/commit/205085d4ccf9c367ba70de9d8f0dd74d6f567c24
DIFF: https://github.com/llvm/llvm-project/commit/205085d4ccf9c367ba70de9d8f0dd74d6f567c24.diff

LOG: [CodeGen] Fix warnings in LowerToPredicatedOp

When creating a new vector type based on another vector type we
should pass in the element count instead of the number of elements
and scalable flag separately.

I encountered this warning whilst compiling this test:

  CodeGen/AArch64/sve-intrinsics-int-compares.ll

Differential revision: https://reviews.llvm.org/D80621

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 579905d748ea..81b50346437c 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -7734,8 +7734,8 @@ SDValue AArch64TargetLowering::LowerToPredicatedOp(SDValue Op,
          Op.getOperand(1).getValueType().isScalableVector() &&
          "Only scalable vectors are supported");
 
-  auto PredTy = VT.getVectorVT(*DAG.getContext(), MVT::i1,
-                               VT.getVectorNumElements(), true);
+  auto PredTy =
+      VT.getVectorVT(*DAG.getContext(), MVT::i1, VT.getVectorElementCount());
   SDValue Mask = getPTrue(DAG, DL, PredTy, AArch64SVEPredPattern::all);
 
   SmallVector<SDValue, 4> Operands = {Mask};


        


More information about the llvm-commits mailing list