[PATCH] D103180: [InstSimplify] Add constant fold for extractelement + splat for scalable vectors

Caroline via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 01:23:41 PDT 2021


CarolineConcatto added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:913
   if (auto *ValSVTy = dyn_cast<ScalableVectorType>(Val->getType())) {
     if (!CIdx->uge(ValSVTy->getMinNumElements())) {
+      if (Constant *SplatVal = Val->getSplatValue())
----------------
sdesmalen wrote:
> nit: `s/!CIdx->uge/CIdx->ult/`
Hey @sdesmalen 
I may be completely wrong, but I believe your suggestion is not possible
https://llvm.org/doxygen/classllvm_1_1ConstantInt.html
If I looked the documentation correctly llvm::constant only has UGE


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103180



More information about the llvm-commits mailing list