[PATCH] D76664: [ConstantFold][NFC] Compile time optimization for large vectors

Marcello Maggioni via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 14:00:56 PDT 2020


kariddi added inline comments.


================
Comment at: llvm/include/llvm/IR/Constants.h:770
+      : ConstantDataSequential(ty, ConstantDataVectorVal, Data),
+        IsSplat(isSplatData(ty, Data)) {}
+  const bool IsSplat;
----------------
This introduces a linear scan in the creation of the ConstantDataVector() class, I wonder if this might be wasteful if "isSplat()" never endsup to be called on a particular vector.

I wonder if moving this scan in "isSplat()" and caching the result might be better (as isSplat() already was an expensive method, while the construction of ConstantDataVector was not)


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

https://reviews.llvm.org/D76664





More information about the llvm-commits mailing list