Extend (truncate (load)) folding
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 11 Dec 2013 11:37:27 +0000 (11:37 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 11 Dec 2013 11:37:27 +0000 (11:37 +0000)
commit3c14ba596248d64cc3f464e244d23abf934cde3e
treed5d3f8003e20fbecafa55ffd539482bea1322546
parent255ee7df297976f93bf1e1b4a00fd78d13a4a449
Extend (truncate (load)) folding

DAGCombiner could fold (truncate (load)) -> smaller load if the original
load was the width of the truncation result or wider.  This patch extends
it to handle cases where the original load was narrower (and so the
extension type stays the same).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197030 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/SystemZ/insert-06.ll