This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC] Adjust AutoUpdater 'masked' address-space access
ClosedPublic

Authored by urnathan on Aug 11 2023, 3:28 PM.

Details

Summary

In working on memcpy et al, I noticed that many of the AutoUpdater's pattern matchers suffer the same issues of
(a) not commonizing similar handling of the intrinsic creation, and
(b) repeatedly checking for the same prefix, and
(c) if the name matched, but other conditions failed, it would fall through to check a different prefix (which could not match).

This one handles the 'masked.$FOO' intrinsics to avoid those deficiences.

Part 1 in a series of N.

Diff Detail

Event Timeline

urnathan created this revision.Aug 11 2023, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 3:28 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
urnathan requested review of this revision.Aug 11 2023, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 3:28 PM
This revision is now accepted and ready to land.Aug 11 2023, 3:33 PM
arsenm added a subscriber: arsenm.Aug 11 2023, 3:34 PM
arsenm added inline comments.
llvm/lib/IR/AutoUpgrade.cpp
1056–1083

You can use consume_front for this instead of startswith+substr

nikic added a subscriber: nikic.Aug 12 2023, 12:10 AM

Is this code needed at all? This looks like something that should be covered by intrinsic remangling. Explicit auto-upgrade should only be needed if you change the name or arguments, but not if you change only mangling.

Is this code needed at all? This looks like something that should be covered by intrinsic remangling. Explicit auto-upgrade should only be needed if you change the name or arguments, but not if you change only mangling.

I don't know, and I'd rather not get further distracted -- think of this as an incomplete reduction towards zero source maybe?