[all-commits] [llvm/llvm-project] 9641a2: [DAG] Add initial SelectionDAG::canCreateUndefOrPo...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Aug 8 07:16:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9641a201a565346bfddfc02b13b2b583c056e61d
      https://github.com/llvm/llvm-project/commit/9641a201a565346bfddfc02b13b2b583c056e61d
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

  Log Message:
  -----------
  [DAG] Add initial SelectionDAG::canCreateUndefOrPoison support

This patch adds basic support for a DAG variant of the canCreateUndefOrPoison call and updates DAGCombiner::visitFREEZE to use it, further Opcodes (including target specific Opcodes) can be handled when we have test coverage.

So far, I've left visitFREEZE to just use this for unary nodes (which currently means the existing BITCAST/FREEZE cases) - later patches will add other unary opcodes (with test coverage) and we can also refactor visitFREEZE to support a general number of operands like we do in InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating.

I'm not aware of any vector test freeze coverage so the DemandedElts (and the Depth) args are not being used yet - but they are in place. Similarly we will be able to handle poison generating SDNodeFlags as and when it becomes an issue.

Part of the work for D106675 / PR50468

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




More information about the All-commits mailing list