This is an archive of the discontinued LLVM Phabricator instance.

[x86] NFC: More refactoring to pave the way to extending this ISel logic to handle other x86 pseudos that carry flags and thus can't be matched by our ISel patterns with fused memory accesses.
ClosedPublic

Authored by chandlerc on Aug 23 2017, 5:22 PM.

Details

Summary

Let me know if this stops making sense and I should just fold my actual
functional changes into this.

Depends on D37045.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Aug 23 2017, 5:22 PM
craig.topper edited edge metadata.Aug 23 2017, 6:24 PM

Is your first version going to handle just registers or immediates too/

lib/Target/X86/X86ISelDAGToDAG.cpp
1959 ↗(On Diff #112486)

Any real reason to pass the load sizes with this? Could we just define an order and just map the types to an index without a loop. Feels like the types starting getting repetitive if we extend this to ADD/SUB/AND/OR/XOR/ADC/SBB which all have this problem.

chandlerc marked an inline comment as done.Aug 23 2017, 6:32 PM

Is your first version going to handle just registers or immediates too/

Not sure, haven't gotten there. Just carving off cleanups where I can.

lib/Target/X86/X86ISelDAGToDAG.cpp
1959 ↗(On Diff #112486)

Good question. I went back and forth. My concern about just defining the order is getting it wrong. But honestly, I think that's not such an issue. I'll go back to hard coding the 4 integer types. We can make something fancier when we actually need it if that day ever arrives.

chandlerc updated this revision to Diff 112497.Aug 23 2017, 7:56 PM
chandlerc marked an inline comment as done.

Update based on review.

craig.topper accepted this revision.Aug 23 2017, 8:53 PM

LGTM with the one comment.

lib/Target/X86/X86ISelDAGToDAG.cpp
1945 ↗(On Diff #112497)

Pass EVT by value.

This revision is now accepted and ready to land.Aug 23 2017, 8:53 PM
chandlerc marked an inline comment as done.Aug 24 2017, 7:06 PM

Made change and landing, thanks!

This revision was automatically updated to reflect the committed changes.