[GlobalISel][AArch64] Gardening: Factor out code to find lane indices
authorJessica Paquette <jpaquette@apple.com>
Wed, 13 Mar 2019 21:19:29 +0000 (21:19 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 13 Mar 2019 21:19:29 +0000 (21:19 +0000)
commitbb1aced80dd6b6044455f0e7b74c595b94122c06
tree722f4418a5a9c40c6f7759a8acd112065f651ff4
parentda644c025dd1dc7a31cb30ca8c66a3b700e06723
[GlobalISel][AArch64] Gardening: Factor out code to find lane indices

Some more refactoring for G_INSERT_VECTOR_ELT.

Factor out the code used to find a lane index from `selectExtractElt`. Put it
into a more general-purpose `getConstantValueForReg` function.

This will be shared with the code for G_INSERT_VECTOR_ELT.

Differential Revision: https://reviews.llvm.org/D59324

llvm-svn: 356101
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp