This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Enable tryToFoldExtendOfConstant to run after legalize vector ops
ClosedPublic

Authored by craig.topper on Nov 8 2018, 5:14 PM.

Details

Summary

It should be ok to create a new build_vector after legal operations so long as it doesn't cause an infinite loop in DAG combiner.

Unfortunately, X86's custom constant folding in combineVSZext is hiding any test changes from this. But I'm trying to get to a point where that X86 specific code isn't necessary at all.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Nov 8 2018, 5:14 PM

DAGCombine can legalize operations even in the "AfterLegalizeDAG" phase; I don't think you need to check for AfterLegalizeDAG at all, unless you're trying to avoid a combining loop.

Remove the LegalOperations/LegalDAG check completel

craig.topper retitled this revision from [DAGCombiner] Enable tryToFoldExtendOfConstant to run between legalize vector ops and legalize DAG to [DAGCombiner] Enable tryToFoldExtendOfConstant to run after legalize vector ops.Nov 10 2018, 4:09 PM
craig.topper edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 12 2018, 2:18 PM
This revision was automatically updated to reflect the committed changes.