This is an archive of the discontinued LLVM Phabricator instance.

[AutoUpgrade] Don't lose attributes when upgrading mem intrinsics
ClosedPublic

Authored by arichardson on Mar 17 2022, 4:32 PM.

Details

Summary

The original AutoUpgrade code from 1e68724d24ba38de7c7cdb2e1939d78c8b37cc0d
did not retain existing attributes. I noticed this in some downstream test
cases but it turns out there is also one affected testcase upstream.

Diff Detail

Event Timeline

arichardson created this revision.Mar 17 2022, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 4:32 PM
arichardson requested review of this revision.Mar 17 2022, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 4:32 PM

Fix another test that benefits from this change

nikic added a reviewer: nikic.Apr 11 2022, 3:05 AM
nikic added a subscriber: nikic.
nikic added inline comments.
llvm/lib/IR/AutoUpgrade.cpp
4080

Don't you need to remove the attributes the the 4th argument (that is being dropped) from the attribute list?

arichardson added inline comments.Apr 11 2022, 3:51 AM
llvm/lib/IR/AutoUpgrade.cpp
4080

Oh yes that's a good point. I guess it hasn't mattered so far since I've not seen an attribute on that argument, let me see what happens if there is one.

Address review comment by @nikic

llvm/lib/IR/AutoUpgrade.cpp
4080

Not sure if there is an better way of generating the new AttributeList, creating a new one seemed like the easiest way.

nikic accepted this revision.Apr 11 2022, 5:29 AM

LGTM

This revision is now accepted and ready to land.Apr 11 2022, 5:29 AM
This revision was landed with ongoing or failed builds.Apr 13 2022, 2:31 AM
This revision was automatically updated to reflect the committed changes.
arichardson marked an inline comment as done.