]> granicus.if.org Git - llvm/commit
[AArch64][GlobalISel] Use fcsel instead of csel for G_SELECT on FPRs
authorJessica Paquette <jpaquette@apple.com>
Fri, 3 May 2019 22:37:46 +0000 (22:37 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 3 May 2019 22:37:46 +0000 (22:37 +0000)
commit7bd3baab03a27b8daded5ce24a57ab30c2b52a99
treed56d6fbacda2c1a74a9a282368ea0cfef6a9b348
parent26506e182a2c6f62b681f4bfc72136112693ce1d
[AArch64][GlobalISel] Use fcsel instead of csel for G_SELECT on FPRs

This saves us some unnecessary copies.

If the inputs to a G_SELECT are floating point, we should use fcsel rather than
csel.

Changes here are...

- Teach selectCopy about s1-to-s1 copies across register banks.
- AArch64RegisterBankInfo about G_SELECT in general.
- Teach the instruction selector about the FCSEL instructions.

Also add two tests:

- select-select.mir to show that we get the expected FCSEL
- regbank-select.mir (unfortunately named) to show the register banks on
G_SELECT are properly preserved

And update fast-isel-select.ll to show that we do the same thing as other
instruction selectors in these cases.

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