OSDN Git Service

[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst...
authorCraig Topper <craig.topper@intel.com>
Sat, 3 Feb 2018 23:00:31 +0000 (23:00 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 3 Feb 2018 23:00:31 +0000 (23:00 +0000)
commit616c32878e5655ebddeb0ccbcd508745ec27dede
tree024f46751a2351fe24ff4553eae1b5a4faf10226
parentf97f105a5824409964c5b8fa734ef89da63332dc
[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst)) -> (and/or/xor (sextload/zextload x), (sext/zext cst)) make sure we check the legality of the full extended load.

Summary:
If the load is already an extended load we should be using the memory VT for the legality check, not just the VT of the current extension.

I don't have a test case, just noticed it while investigating some load extension improvements.

Reviewers: RKSimon, spatel, niravd

Reviewed By: niravd

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D42783

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324181 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp