[PATCH] D130646: [DAG] Add initial SelectionDAG::canCreateUndefOrPoison support

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 09:56:18 PDT 2022


RKSimon created this revision.
RKSimon added reviewers: nlopes, aqjune, efriedma, spatel, craig.topper.
Herald added subscribers: StephenFan, ecnelises, steven.zhang, hiraditya.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added a project: LLVM.

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 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 <https://reviews.llvm.org/D106675> / PR50468


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130646

Files:
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130646.448084.patch
Type: text/x-patch
Size: 7278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/fc13f2b4/attachment.bin>


More information about the llvm-commits mailing list