OSDN Git Service

[DAGCombiner] Call ExtendUsesToFormExtLoad in (zext (and (load)))->(and (zextload...
authorCraig Topper <craig.topper@intel.com>
Thu, 15 Feb 2018 20:20:32 +0000 (20:20 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 15 Feb 2018 20:20:32 +0000 (20:20 +0000)
commit297d461b01064d23701da6cb30e920e87f44e5e8
treef7b289580ebedc7bf174a92ffa440e5ac58c386d
parent37496d05582c786c22c4fa2447fddb0308b7213e
[DAGCombiner] Call ExtendUsesToFormExtLoad in (zext (and (load)))->(and (zextload)) even when the and does not have multiple uses

Same for the sign extend case.

Currently we check for multiple uses on the binop. Then we call ExtendUsesToFormExtLoad to capture SetCCs that use the load. So we only end up finding any setccs when the and has additional uses and the load is used by a setcc. I don't think the and having multiple uses is relevant here. I think we should only be checking for the load having multiple uses.

This changes an NVPTX test because we now find that the load has a second use by a truncate, but ExtendUsesToFormExtLoad only looks at setccs it can extend. All other operations just check isTruncateFree. Maybe we should allow widening of an existing truncate even if its not free?

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325289 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/NVPTX/param-load-store.ll