This is an archive of the discontinued LLVM Phabricator instance.

Add address space argument to allowsUnalignedMemoryAccess.
ClosedPublic

Authored by arsenm on Jan 8 2014, 1:56 PM.

Details

Reviewers
qcolombet
arsenm
Summary

On R600, some address spaces have more strict alignment requirements than others.

Updating the uses to pass the address space will be a separate patch.

Diff Detail

Event Timeline

arsenm updated this revision to Unknown Object (????).Jan 8 2014, 1:58 PM

Attach right version of patch that swaps order of arguments

qcolombet requested changes to this revision.Jan 21 2014, 10:29 AM

Hi Matt,

The overall fix goes in the right direction, but you have a couple of typos in the subclasses when you overload the allowsUnalignedMemoryAccesses.

I am not in favor of the change of order for the Fast argument in the modified API.
Indeed, because of that change, every call that uses the Fast argument will need to be updated (like you did for the ARM backend).
Therefore, I would prefer to have:
virtual bool allowsUnalignedMemoryAccesses(EVT, bool * /*Fast*/ = 0, unsigned AddrSpace = 0) const

That said, I understand the form you are proposing is more convenient for your target, thus if the majority agrees for the order change, I can cope with that :).

Thanks,

Quentin

include/llvm/Target/TargetLowering.h
715

Since you are updating the command, you could fix the typo here :).
The sentence is not finished here, thus the period should be removed.

717

if we decide to go with your API change:
s/second/third/

719

I believe.
s/It’s/Its/

lib/Target/Mips/MipsSEISelLowering.cpp
249

Same here.

lib/Target/Mips/MipsSEISelLowering.h
34

This prototype does not match the base class.
You’ve inverted the order of bool and unsigned.

The reason I swapped the order was because the address space could be necessary for correctness, but Fast in principle could always be optional. When updating the uses of it, more places required throwing in a null pointer for Fast just to specify the address space rather than the other way around.

By correctness I mean the actual answer instead of the conservatively correct false.

Fair enough.

Still there are a bunch of places where you forgot to swap the arguments.
See my inlined comments.

Thanks,
-Quentin

arsenm updated this revision to Unknown Object (????).Jan 23 2014, 1:58 PM

Fix typos and Mips's implementation being swapped

Hi Matt,

This is looking good. There is just one little quirk that I mentioned in the inline comments.

With this change, LGTM.

Thanks,
Quentin

lib/Target/Mips/MipsSEISelLowering.h
34

You’ll need to set the default value for Fast as well.

arsenm accepted this revision.Feb 5 2014, 3:22 PM

r200887

arsenm accepted this revision.Feb 5 2014, 3:23 PM
qcolombet accepted this revision.Jul 28 2015, 4:01 PM
qcolombet edited edge metadata.

It landed a while ago: r200887

This revision is now accepted and ready to land.Jul 28 2015, 4:01 PM
qcolombet closed this revision.Jul 28 2015, 4:01 PM