Skip to content
Commit df4e0bea authored by Senran Zhang's avatar Senran Zhang Committed by Fangrui Song
Browse files

[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
parent faeb7ec6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment