This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Bugfix in storeLoadCanUseBlockBinary()
ClosedPublic

Authored by jonpa on Jun 11 2020, 10:01 AM.

Details

Summary

Check that the MemoryVT of LoadA matches that of LoadB.

This fixes https://bugs.llvm.org/show_bug.cgi?id=46239.

Does not affect benchmarks.

Diff Detail

Event Timeline

jonpa created this revision.Jun 11 2020, 10:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2020, 10:01 AM

Shouldn't the check be done inside canUseBlockOperation? I believe the other user (storeLoadCanUseMVC) really needs the same check.

Shouldn't the check be done inside canUseBlockOperation? I believe the other user (storeLoadCanUseMVC) really needs the same check.

My understanding is that storeLoadCanUseBlockBinary() is used as a pattern matching predicate for block memory operations of AND/OR/XOR. These involve two loads and one store. While canUseBlockOperation() has checks for a pair of a store and the load (of the other address), the second load (to the same address as the store) also needs to be checked, which is what this patch does.

The other user of canUseBlockOperation() is storeLoadCanUseMVC() which however only involves one load and one store, and this is why there is no need for anything else in this case.

uweigand accepted this revision.Jun 16 2020, 12:44 AM

Shouldn't the check be done inside canUseBlockOperation? I believe the other user (storeLoadCanUseMVC) really needs the same check.

My understanding is that storeLoadCanUseBlockBinary() is used as a pattern matching predicate for block memory operations of AND/OR/XOR. These involve two loads and one store. While canUseBlockOperation() has checks for a pair of a store and the load (of the other address), the second load (to the same address as the store) also needs to be checked, which is what this patch does.

The other user of canUseBlockOperation() is storeLoadCanUseMVC() which however only involves one load and one store, and this is why there is no need for anything else in this case.

Ah, you're right, I missed the existing check in canUseBlockOperation. This patch is OK then.

This revision is now accepted and ready to land.Jun 16 2020, 12:44 AM
This revision was automatically updated to reflect the committed changes.