]> granicus.if.org Git - llvm/commit
[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp
authorJessica Paquette <jpaquette@apple.com>
Mon, 3 Jun 2019 20:47:20 +0000 (20:47 +0000)
committerJessica Paquette <jpaquette@apple.com>
Mon, 3 Jun 2019 20:47:20 +0000 (20:47 +0000)
commit9a8a4308600526fbb991fb0989bc78af0d925bf5
tree12543251f60aac0ae6911dca679d553b5d39852c
parentce460f86f6243a1e3930ed63bc847604ea597cd6
[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp

Instead of emitting all of the test stuff for a compare when it's only used by
a select, instead, just emit the compare + select. The select will use the
value of NZCV correctly, so we don't need to emit all of the test instructions
etc.

For now, only support fp selects which use G_FCMP. Also only support condition
codes which will only require one select to represent.

Also add a test.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362446 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64InstructionSelector.cpp
test/CodeGen/AArch64/GlobalISel/fold-fp-select.mir [new file with mode: 0644]