[all-commits] [llvm/llvm-project] 9bbf27: [AArch64] Move isOverflowIntrOpRes help function t...

topperc via All-commits all-commits at lists.llvm.org
Thu Feb 20 09:17:54 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9bbf271fc9d5b84f9e657805dfff0fb8a1607af4
      https://github.com/llvm/llvm-project/commit/9bbf271fc9d5b84f9e657805dfff0fb8a1607af4
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-02-20 (Thu, 20 Feb 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

  Log Message:
  -----------
  [AArch64] Move isOverflowIntrOpRes help function to the ISD namespace in SelectionDAG.h. NFC

Enables sharing with an upcoming X86 change.


  Commit: 3543ac9ab52df77af55a2ebdeeddfb76aba15d29
      https://github.com/llvm/llvm-project/commit/3543ac9ab52df77af55a2ebdeeddfb76aba15d29
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-02-20 (Thu, 20 Feb 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp

  Log Message:
  -----------
  [X86] Rewrite LowerBRCOND to remove dead code and handle ISD::SETCC and overflow ops directly.

There's a lot of old leftover code in LowerBRCOND. Especially
the detecting or AND or OR of X86ISD::SETCC nodes. Those were
needed before LegalizeDAG was changed to visit nodes before
their operands.

It also relied on reversing the output of LowerSETCC to find the
flags producing node to use for the X86ISD::BRCOND node.

Rather than using LowerSETCC this patch uses emitFlagsForSetcc to
handle the integer ISD::SETCC case. This gives the flag producer
and the comparison code to use directly. I've removed the addTest
flag and just produce a X86ISD::BRCOND and return immediately.

Floating point ISD::SETCC case is just an X86ISD::FCMP with special
care for OEQ and UNE derived from the previous code. I've left
f128 out so it will emit a test. And LowerSETCC will be called
later to produce a libcall and X86ISD::SETCC. We have combines
that can merge the test and X86ISD::SETCC.

We need to handle two cases for overflow ops. Either they are used
directly or they have a seteq 0 or setne 1 to invert the overflow.
The old code did not handle the setne 1 case, but I think some
other combines were making up for it.

If we fail to find a condition, we'll wrap an AND with 1 on the
original condition and tell emitFlagsForSetcc to emit a compare
with 0. This will pickup the LowerAndToBT and or the EmitTest case.
I kept the isTruncWithZeroHighBitsInput call, but we might be able
to fold that in to emitFlagsForSetcc.

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


Compare: https://github.com/llvm/llvm-project/compare/914a97a4e618...3543ac9ab52d


More information about the All-commits mailing list