[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for extracts
authorJessica Paquette <jpaquette@apple.com>
Fri, 26 Apr 2019 21:53:13 +0000 (21:53 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 26 Apr 2019 21:53:13 +0000 (21:53 +0000)
commit76f64b665bb12b0097a71c10b21a1d302bc84229
treebd3329a931dad4ddc1fad5a5169e458df8a7de82
parent5f163c7e2e62a6c003960930419998d223076538
[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for extracts

getConstantVRegValWithLookThrough does the same thing as the
getConstantValueForReg function, and has more visibility across GISel. Plus, it
supports looking through G_TRUNC, G_SEXT, and G_ZEXT. So, we get better code
reuse and more functionality for free by using it.

Add some test cases to select-extract-vector-elt.mir to show that we can now
look through those instructions.

llvm-svn: 359351
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/select-extract-vector-elt.mir