[DAG] Don't fold zext(logicalshift(zext(x),c)) -> logicalshift(zext(x),c) if the...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Mar 2023 17:43:56 +0000 (17:43 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Mar 2023 17:45:12 +0000 (17:45 +0000)
commit28a0d0e85ab5fe9ccc5cd684bd28bfb15f661f45
tree26695d1f8e1f7dd673d824441949931bd89de108
parent1358df4dc4a9f8193767f2bd03ef4d8e9f04ace6
[DAG] Don't fold zext(logicalshift(zext(x),c)) -> logicalshift(zext(x),c) if the outer zext is free

Avoid widening the shift to a bigger type if the zext would be free anyway

Pulled out of D146121
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/zext-lshr.ll
llvm/test/CodeGen/X86/zext-shl.ll