This is an archive of the discontinued LLVM Phabricator instance.

Fix canFoldInAddressingMode in DAGCombiner.cpp
ClosedPublic

Authored by fdeferriere on Apr 21 2015, 5:53 AM.

Details

Summary

In the function canFoldInAddressingMode, VT is computed as the type of the destination/source of a LOAD/STORE operations, instead of the memory type of the operation.
On targets with a scaling factor on the offset of the LOAD/STORE operations, the function may return false for actually valid cases. This may then prevent the selection of profitable pre or post indexed load/store operations, and instead select pre or post indexed load/store for unprofitable cases.

Diff Detail

Event Timeline

fdeferriere retitled this revision from to Fix canFoldInAddressingMode in DAGCombiner.cpp.
fdeferriere updated this object.
fdeferriere edited the test plan for this revision. (Show Details)
fdeferriere added a reviewer: qcolombet.
fdeferriere added a subscriber: Unknown Object (MLST).
qcolombet edited edge metadata.Apr 21 2015, 9:50 AM

Hi François,

Any chance you can add a test case for this change?
I reckon that may be difficult, but if you can come up with something that would be great!

Thanks,
-Quentin

fdeferriere added a comment.EditedApr 24 2015, 3:59 AM

Hi Quentin,

I compiled a number of benches with an LLVM/arm compiler, and looked for differences in code generation with/without this patch, with no success. I also failed to reproduce it on a dedicated test case.I did not try on other targets
Thus, sorry, I won't be able to provide you with a test case for this patch.

-François.

qcolombet accepted this revision.Apr 24 2015, 10:02 AM
qcolombet edited edge metadata.

Thanks for trying François.

LGTM then.

I'll commit on your behalf, shortly.

Cheers,
-Quentin

This revision is now accepted and ready to land.Apr 24 2015, 10:02 AM
This revision was automatically updated to reflect the committed changes.