[PATCH] D70985: [ConstantFold][SVE] Skip scalable vectors in ConstantFoldInsertElementInstruction.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 10:52:40 PST 2019


spatel added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:836-837
 
+  // Should not iterate over scalable vector, as num element is known at
+  // runtime.
+  VectorType *ValTy = cast<VectorType>(Val->getType());
----------------
It would be clearer to say:
  // Do not iterate on scalable vector. 
  // The number of elements is unknown at compile-time.


================
Comment at: llvm/test/Analysis/ConstantFolding/insertelement.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
----------------
This should RUN with "-constprop" rather than "-instcombine".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70985





More information about the llvm-commits mailing list