[DAGCombiner] Pass the original load to ExtendSetCCUses not the turncate.
authorCraig Topper <craig.topper@intel.com>
Tue, 6 Feb 2018 03:23:27 +0000 (03:23 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 6 Feb 2018 03:23:27 +0000 (03:23 +0000)
commitee1f34eb9aea0d5bd602daa66d7b122ae3f2755f
tree4a4c0def1c10fbcffffb42b93f586536db070933
parent4d170c801bd9dd299b0af8cd943457b921ce9919
[DAGCombiner] Pass the original load to ExtendSetCCUses not the turncate.

Summary:
This method is trying to use the truncate node to find which SETCC operand should be replaced directly with the extended load.

This used to work correctly because all uses of the original load were replaced by the truncate before this function was called. So this was used to effectively bypass the truncate and find the load under it.

All but one of the callers now call this before the truncate has replaced the laod so the setcc doesn't yet use the truncate. To account for this we should pass the original load instead.

I changed the order of that one caller to make this work there too.

I don't have a test case because this is probably hidden by later DAG combines causing the extend and truncate to cancel out. I assume this way is a little more efficient and matches what was originally intended.

Reviewers: RKSimon, spatel, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

llvm-svn: 324311
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp