[PATCH] D81619: [NFC] Bail out for scalable vectors before calling getNumElements

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 10:23:41 PDT 2020


fpetrogalli added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2697
 
+  SmallVector<Constant *, 4> Result(
+      cast<FixedVectorType>(VTy)->getNumElements());
----------------
Given that from now on the vector is supposed to have a fixed size, maybe it is also worth defining `auto FixedVTy = cast<FixedVectorType>(VTy)` and use `FixedVTy` in place of `VTy` all through the end of the function?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81619





More information about the llvm-commits mailing list