[PATCH] D87918: [InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicateAndConstant.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 11:26:55 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ad6049736c5: [InstCombine][SVE] Skip scalable type for InstCombiner… (authored by huihuiz).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87918/new/

https://reviews.llvm.org/D87918

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/vscale_cmp.ll


Index: llvm/test/Transforms/InstCombine/vscale_cmp.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/InstCombine/vscale_cmp.ll
@@ -0,0 +1,11 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define <vscale x 2 x i1> @sge(<vscale x 2 x i8> %x) {
+; CHECK-LABEL: @sge(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sge <vscale x 2 x i8> [[X:%.*]], zeroinitializer
+; CHECK-NEXT:    ret <vscale x 2 x i1> [[CMP]]
+;
+  %cmp = icmp sge <vscale x 2 x i8> %x, zeroinitializer
+  ret <vscale x 2 x i1> %cmp
+}
Index: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -5260,8 +5260,8 @@
     // Bail out if the constant can't be safely incremented/decremented.
     if (!ConstantIsOk(CI))
       return llvm::None;
-  } else if (auto *VTy = dyn_cast<VectorType>(Type)) {
-    unsigned NumElts = cast<FixedVectorType>(VTy)->getNumElements();
+  } else if (auto *FVTy = dyn_cast<FixedVectorType>(Type)) {
+    unsigned NumElts = FVTy->getNumElements();
     for (unsigned i = 0; i != NumElts; ++i) {
       Constant *Elt = C->getAggregateElement(i);
       if (!Elt)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87918.292854.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200918/a3eaf932/attachment.bin>


More information about the llvm-commits mailing list