[DAG] visitShiftByConstant - replace constant detection with FoldConstantArithmetic
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 17 Oct 2022 15:19:02 +0000 (16:19 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 17 Oct 2022 15:19:10 +0000 (16:19 +0100)
commit8e77458578d601cf714c0f444667f83ea2840621
tree469833b1d77d34184b5905ab80030925a556019d
parent45cadb4bd36b479dfc4daff451a6c924703ec7e0
[DAG] visitShiftByConstant - replace constant detection with FoldConstantArithmetic

Instead of checking that an operand is constant/opaque before calling getNode() and then checking that the result is a constant, just use FoldConstantArithmetic which will just early-out if the operands are not constant foldable.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp