[all-commits] [llvm/llvm-project] 438ac2: [X86] combineAddOrSubToADCOrSBB - Fold ADD/SUB + (...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Mar 21 14:38:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 438ac282db97c584daf2d4d1a90e6b3d49ef9189
      https://github.com/llvm/llvm-project/commit/438ac282db97c584daf2d4d1a90e6b3d49ef9189
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-21 (Mon, 21 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/add-sub-bool.ll

  Log Message:
  -----------
  [X86] combineAddOrSubToADCOrSBB - Fold ADD/SUB + (AND(SRL(X,Y),1) -> ADC/SBB+BT(X,Y) (REAPPLIED)

As suggested on PR35908, if we are adding/subtracting an extracted bit, attempt to use BT instead to fold the op and use a ADC/SBB op.

Reapply with extra type legality checks - LowerAndToBT was originally only used during lowering, now that it can occur earlier we might encounter illegal types that we can either promote to i32 or just bail.

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




More information about the All-commits mailing list