[PATCH] D51197: [GISel]: Add missing opcodes for overflow intrinsics

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 23 16:44:05 PDT 2018


aditya_nandakumar created this revision.
aditya_nandakumar added reviewers: ab, bogner, dsanders, aemerson, rtereshin, volkan, qcolombet, arsenm, igorb.
Herald added a subscriber: wdng.
Herald added a reviewer: javed.absar.

Currently, IRTranslator (and GISel) seems to be arbitrarily picking which overflow intrinsics get mapped into opcodes which either have a carry as an input or not.
For intrinsics such as Intrinsic::uadd_with_overflow, translate it to an opcode (G_UADDO) which doesn't have any carry inputs (similar to LLVM IR).

This patch adds 4 missing opcodes for completeness - G_UADDO, G_USUBO, G_SSUBE and G_SADDE.

As there is already some code that's selecting G_UADDE (X86) - I haven't changed X86's legalizerinfo. G_UADDEs can still be produced through legalization/combines etc.


Repository:
  rL LLVM

https://reviews.llvm.org/D51197

Files:
  include/llvm/Support/TargetOpcodes.def
  include/llvm/Target/GenericOpcodes.td
  lib/CodeGen/GlobalISel/IRTranslator.cpp
  test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
  test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51197.162296.patch
Type: text/x-patch
Size: 8715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180823/c169f753/attachment.bin>


More information about the llvm-commits mailing list