[ConstantFold][NFC] Compile time optimization for large vectors
authorThomas Raoux <thomasraoux@google.com>
Mon, 30 Mar 2020 17:36:21 +0000 (10:36 -0700)
committerThomas Raoux <thomasraoux@google.com>
Mon, 30 Mar 2020 18:27:09 +0000 (11:27 -0700)
commit3ea0774b13a538759aa1a68f30130d18ddb0d3f2
treef19bd3ecf25f6fd958a60bc909e185b98b4eea2f
parent8242509a49e019c0279305d152c7ab2b9cdc2d0d
[ConstantFold][NFC] Compile time optimization for large vectors

Optimize the common case of splat vector constant. For large vector
going through all elements is expensive. For splatr/broadcast cases we
can skip going through all elements.

Differential Revision: https://reviews.llvm.org/D76664
llvm/include/llvm/IR/Constants.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/IR/ConstantFold.cpp
llvm/lib/IR/Constants.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp