Revert "Revert "[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT...
authorAmara Emerson <aemerson@apple.com>
Wed, 5 Jun 2019 23:46:16 +0000 (23:46 +0000)
committerAmara Emerson <aemerson@apple.com>
Wed, 5 Jun 2019 23:46:16 +0000 (23:46 +0000)
commitc37ff0d138aff7b3307d33c82766dc7b07d4ea6b
tree6106b4518f39d823774e5cc61fc6db650680c4da
parent34c8b835b16fb3879f1b9770e91df21883356bb6
Revert "Revert "[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp""

When looking through copies, make sure to not try to find the vreg def of a physreg.
Normally getVRegDef will return nullptr in this case, but if there happens to be
multiple defs then it will assert.

This fixes PR42129.

llvm-svn: 362666
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/fold-fp-select.mir [new file with mode: 0644]