[all-commits] [llvm/llvm-project] 2b59e9: [DAGCombine] Remove the getNegatibleCost to avoid ...

QingShan Zhang via All-commits all-commits at lists.llvm.org
Tue May 19 19:12:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b59e9f1bdd8d0f8a315f9ddba2cdc87a3e682fb
      https://github.com/llvm/llvm-project/commit/2b59e9f1bdd8d0f8a315f9ddba2cdc87a3e682fb
  Author: QingShan Zhang <qshanz at cn.ibm.com>
  Date:   2020-05-20 (Wed, 20 May 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/test/CodeGen/X86/neg_fp.ll

  Log Message:
  -----------
  [DAGCombine] Remove the getNegatibleCost to avoid the out of sync with getNegatedExpression

We have the getNegatibleCost/getNegatedExpression to evaluate the cost and negate the expression.
However, during negating the expression, the cost might change as we are changing the DAG,
and then, hit the assertion if we negated the wrong expression as the cost is not trustful anymore.

This patch is target to remove the getNegatibleCost to avoid the out of sync with getNegatedExpression,
and check the cost during negating the expression. It also reduce the duplicated code between
getNegatibleCost and getNegatedExpression. And fix the crash for the test in D76638

Reviewed By: RKSimon, spatel

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




More information about the All-commits mailing list