[all-commits] [llvm/llvm-project] 20bf0c: [TargetLowering] optimizeSetCCToComparisonWithZero...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Wed Oct 23 02:02:31 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 20bf0cf2f020ce3b344838b88d8a86e156c05443
      https://github.com/llvm/llvm-project/commit/20bf0cf2f020ce3b344838b88d8a86e156c05443
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2019-10-23 (Wed, 23 Oct 2019)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    A llvm/test/CodeGen/X86/pr43769.ll

  Log Message:
  -----------
  [TargetLowering] optimizeSetCCToComparisonWithZero(): add extra sanity checks (PR43769)

We should do the fold only if both constants are plain,
non-opaque constants, at least that is the DAG.FoldConstantArithmetic()
requirement.
And if the constant we are comparing with is zero - we shouldn't be
trying to do this fold in the first place.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43769




More information about the All-commits mailing list