[all-commits] [llvm/llvm-project] a5ae3e: [IR] CmpInst: add getUnsignedPredicate()

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Nov 6 00:31:55 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a5ae3edaa380702eb2be225721533c1aab2f4d3e
      https://github.com/llvm/llvm-project/commit/a5ae3edaa380702eb2be225721533c1aab2f4d3e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/lib/IR/Instructions.cpp

  Log Message:
  -----------
  [IR] CmpInst: add getUnsignedPredicate()

There's already getSignedPredicate(), it is not symmetrical to not have
it's opposite. I wanted to use it in new code, but it wasn't there..


  Commit: c7c702a272f6b1a3578460eefc07e1282b43cf13
      https://github.com/llvm/llvm-project/commit/c7c702a272f6b1a3578460eefc07e1282b43cf13
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/lib/IR/Instructions.cpp

  Log Message:
  -----------
  [IR] CmpInst: add isEquality(Pred)

Currently there is only a member version of isEquality(),
which requires an actual [IF]CmpInst to be avaliable,
which isn't always possible, and is inconsistent with
the general pattern here.

I wanted to use it in a new patch, but it wasn't there..


  Commit: d4f70d64547a1cf9a39e29dc4b70e53158df49fb
      https://github.com/llvm/llvm-project/commit/d4f70d64547a1cf9a39e29dc4b70e53158df49fb
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h

  Log Message:
  -----------
  [IR] CmpInst: add isRelational()

Since there's CmpInst::isEquality(), it only makes sense
to have it's inverse for consistency.


  Commit: 8d0fdd36a3a3e7d1bb07c34ab61cfe2671d13444
      https://github.com/llvm/llvm-project/commit/8d0fdd36a3a3e7d1bb07c34ab61cfe2671d13444
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

  Log Message:
  -----------
  [IR] CmpInst: Add getFlippedSignednessPredicate()

And refactor a few places to use it


Compare: https://github.com/llvm/llvm-project/compare/5e312e004197...8d0fdd36a3a3


More information about the All-commits mailing list