[all-commits] [llvm/llvm-project] 236197: [ConstantFold] Simplify evaluateICmpRelation() imp...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Nov 3 05:13:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 236197a065879c900a450e5236adbb76578006cb
      https://github.com/llvm/llvm-project/commit/236197a065879c900a450e5236adbb76578006cb
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M llvm/lib/IR/ConstantFold.cpp

  Log Message:
  -----------
  [ConstantFold] Simplify evaluateICmpRelation() implementation (NFCI)

Clarify that most of this only works on pointer icmps, and remove
the unnecessary isSigned parameter, as well as the ConstantInt
fallback.

Also perform complexity sorting upfront, so we don't need to deal
with swapped cases in the individual branches.


  Commit: 05a47706476f3cd467aa1c4347fdfb71bcbc1252
      https://github.com/llvm/llvm-project/commit/05a47706476f3cd467aa1c4347fdfb71bcbc1252
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M llvm/lib/IR/ConstantFold.cpp
    M llvm/test/Transforms/InstSimplify/ConstProp/icmp-global.ll

  Log Message:
  -----------
  [ConstantFold] Fix incorrect type assumptions

If a pointer isn't a constant expression, global or block address,
it's not guaranteed to be a null pointer. It can also be a no_cfi
or dso_local_equivalent constant.


Compare: https://github.com/llvm/llvm-project/compare/51485019fb34...05a47706476f


More information about the All-commits mailing list