This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Pass the original load to ExtendSetCCUses not the turncate.
ClosedPublic

Authored by craig.topper on Feb 2 2018, 7:38 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 2 2018, 7:38 PM
niravd accepted this revision.Feb 5 2018, 1:21 PM

LGTM.

This revision is now accepted and ready to land.Feb 5 2018, 1:21 PM
This revision was automatically updated to reflect the committed changes.