[DAG] mergeStore - peek through truncates when finding dead store(trunc(load()))...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Mar 2023 11:36:00 +0000 (11:36 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Mar 2023 11:54:13 +0000 (11:54 +0000)
commitc1f81e7604457fa0b6c8bc03745c41d511106040
treea13b9ade1dd41ce48f1af65467ab76eb5ca1eb1d
parent7501e53b8d6d7563b047a34d0141630d5afc86c5
[DAG] mergeStore - peek through truncates when finding dead store(trunc(load())) patterns

Extend the existing store(load()) removal code to account for intermediate truncates that some targets won't remove with canCombineTruncStore - we only care about the load/store MemoryVT.

Fixes regression from D146121
llvm/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/illegal-bitfield-loadstore.ll