Generalize ExtendUsesToFormExtLoad to be usable for ANY_EXTEND,
authorDan Gohman <gohman@apple.com>
Thu, 9 Apr 2009 03:51:29 +0000 (03:51 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 9 Apr 2009 03:51:29 +0000 (03:51 +0000)
commit57fc82d409022e793446c1c5d7d6d8b0d7579f83
tree97ab2b8425ae0bcfaf3f82b3d7fd79208f68f716
parent7d770be047059d624f37c6fb1e5b1d0f2b4961b3
Generalize ExtendUsesToFormExtLoad to be usable for ANY_EXTEND,
in addition to ZERO_EXTEND and SIGN_EXTEND. Fix a bug in the
way it checked for live-out values, and simplify the way it
find users by using SDNode::use_iterator's (relatively) new
features. Also, make it slightly more permissive on targets
with free truncates.

In SelectionDAGBuild, avoid creating ANY_EXTEND nodes that are
larger than necessary. If the target's SwitchAmountTy has
enough bits, use it. This exposes the truncate to optimization
early, enabling more optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68670 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
test/CodeGen/X86/2008-09-10-SpillerBug2.ll [deleted file]
test/CodeGen/X86/anyext-uses.ll [new file with mode: 0644]
test/CodeGen/X86/switch-zextload.ll [new file with mode: 0644]