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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 00:41:40 PDT 2021


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

The patch looks fine to me with the nit addressed.



================
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())
----------------
nit: `s/!CIdx->uge/CIdx->ult/`


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