This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Bugfix in adjustSubwordCmp()
ClosedPublic

Authored by jonpa on Apr 15 2020, 2:57 AM.

Details

Summary

adjustSubwordCmp should not optimize a load of an i1 value.

This is achieved by checking that the size and store-size of the MemoryVT are the same.

Fixes https://bugs.llvm.org/show_bug.cgi?id=45511.

Diff Detail

Event Timeline

jonpa created this revision.Apr 15 2020, 2:57 AM
jonpa added a comment.Apr 15 2020, 3:16 AM

It seems that adjustSubwordCmp() actually was the only place in need of a fix: Even though the extension type of the load (sext from i1) is changed there now is also a sign extend inreg from i1 taking place.

I added a check in adjustSubwordCmp() to make sure that the MemoryVT has the same store size as size. This catches the case where the size is 1 but store size is 8, while it seems to not affect benchmarks or any other tests.

uweigand accepted this revision.Apr 15 2020, 3:18 AM

LGTM, thanks!

This revision is now accepted and ready to land.Apr 15 2020, 3:18 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2020, 4:21 AM