This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Combine fshl/fshr(load1,load0,c) if we have consecutive loads
ClosedPublic

Authored by RKSimon on Mar 4 2020, 9:46 AM.

Details

Summary

As noted on D75114, if both arguments of a funnel shift are consecutive loads we are missing the opportunity to combine them into a single load.

Diff Detail

Event Timeline

RKSimon created this revision.Mar 4 2020, 9:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2020, 9:46 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
efriedma added inline comments.Mar 4 2020, 11:40 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
8271

Do you need to check whether unaligned loads are supported for the given type?

RKSimon marked an inline comment as done.Mar 4 2020, 12:54 PM
RKSimon added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
8271

Thanks, I'll add an TLI.allowsMemoryAccess check - speaking of which, a lot of combines seem to use a getABITypeAlignment check which seems like overkill to me?

efriedma added inline comments.Mar 4 2020, 1:06 PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
8271

Yes, that seems like overkill.

RKSimon updated this revision to Diff 248437.Mar 5 2020, 4:29 AM

Add allowsMemoryAccess check to ensure alignment is legal and fast

efriedma accepted this revision.Mar 5 2020, 1:20 PM

LGTM

This revision is now accepted and ready to land.Mar 5 2020, 1:20 PM
This revision was automatically updated to reflect the committed changes.