[NFC][ConstantFold] Check getAggregateElement before getSplatValue call
Constant::getSplatValue has O(N) time complexity in the worst case, where N is the # of elements in a vector. So we call Constant::getAggregateElement first and return earlier if possible to avoid unnecessary getSplatValue calls. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107252
Loading
Please sign in to comment