[all-commits] [llvm/llvm-project] b15491: [AArch64][GlobalISel] Select G_SADDO and G_SSUBO

Jessica Paquette via All-commits all-commits at lists.llvm.org
Tue Dec 8 09:23:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b15491eb333809e907e51d1b05da2a6a6344a427
      https://github.com/llvm/llvm-project/commit/b15491eb333809e907e51d1b05da2a6a6344a427
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
    A llvm/lib/Target/AArch64/GISel/select-saddo.mir
    A llvm/lib/Target/AArch64/GISel/select-ssubo.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Select G_SADDO and G_SSUBO

We didn't have selector support for these.

Selection code is similar to `getAArch64XALUOOp` in AArch64ISelLowering. Similar
to that code, this returns the AArch64CC and the instruction produced. In SDAG,
this is used to optimize select + overflow and condition branch + overflow
pairs. (See `AArch64TargetLowering::LowerBR_CC` and
`AArch64TargetLowering::LowerSelect`)

(G_USUBO should be easy to add here, but it isn't legalized right now.)

This also factors out the existing G_UADDO selection code, and removes an
unnecessary check for s32/s64. AFAIK, we shouldn't ever get anything other than
s32/s64. It makes more sense for this to be handled by the type assertion in
`emitAddSub`.

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




More information about the All-commits mailing list