[NFC] Bail out for scalable vectors before calling getNumElements
authorChristopher Tetreault <ctetreau@quicinc.com>
Tue, 16 Jun 2020 20:19:15 +0000 (13:19 -0700)
committerChristopher Tetreault <ctetreau@quicinc.com>
Tue, 16 Jun 2020 20:41:29 +0000 (13:41 -0700)
commitb265cad93e70815cfad5eaaacfb095276a9a4213
treeb6146de5f7b18cfa66978c9ed3a754f86a272cf3
parent747486991cc452f7a1861e4a7a30d069d5f34aab
[NFC] Bail out for scalable vectors before calling getNumElements

Summary:
Move the bail out logic to before constructing the Result and Lane
vectors. This is both potentially faster, and avoids calling
getNumElements on a potentially scalable vector

Reviewers: efriedma, sunfish, chandlerc, c-rhodes, fpetrogalli

Reviewed By: fpetrogalli

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81619
llvm/lib/Analysis/ConstantFolding.cpp