This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix usage of Align constructing MachineMemOperands.
ClosedPublic

Authored by craig.topper on May 4 2020, 5:07 PM.

Details

Summary

Similar to D77687, but for the X86 specific code.

Diff Detail

Event Timeline

craig.topper created this revision.May 4 2020, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2020, 5:07 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
efriedma added inline comments.May 5 2020, 10:50 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
8691

Ultimately, we want to get rid of the MaybeAlign overload of getLoad(); please compute the alignment explicitly here. I guess DAG.getEVTAlign(MVT::getVectorVT(CVT, NumElm))?

craig.topper marked an inline comment as done.May 5 2020, 11:35 AM
craig.topper added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
8691

Based on what I found in D79436 where I'm converting ConstantPoolSDNode to use Align, I don't think we ever create ConstantPoolSDNodes with a 0 alignment. Can I fix this when I remove getAlignment from ConstantPoolSDNode?

efriedma added inline comments.May 5 2020, 1:09 PM
llvm/lib/Target/X86/X86ISelLowering.cpp
8691

If you're confident getAlignment() never returns zero, please just cast to Align, not MaybeAlign.

Use Align on calls to getAlignment for ConstantPoolSDNodes.

efriedma accepted this revision.May 5 2020, 2:30 PM

LGTM

This revision is now accepted and ready to land.May 5 2020, 2:30 PM
This revision was automatically updated to reflect the committed changes.