This is an archive of the discontinued LLVM Phabricator instance.

[CLANG][BPF] permit any argument type for __builtin_preserve_access_index()
ClosedPublic

Authored by yonghong-song on Sep 21 2019, 10:50 AM.

Details

Summary

Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index()
signature") changed the builtin function signature to

PointerT __builtin_preserve_access_index(PointerT ptr)

with a pointer type as the argument/return type, where argument and
return types must be the same.

There is really no reason for this constraint. The builtin just
presented a code region so that IR builtins

__builtin_{array, struct, union}_preserve_access_index

can be applied.

This patch removed the pointer type restriction to permit any
argument type as long as it is permitted by the compiler.

Diff Detail

Event Timeline

yonghong-song created this revision.Sep 21 2019, 10:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2019, 10:50 AM
ast accepted this revision.Sep 22 2019, 10:09 AM

I tested few different examples. Generated code and relocations look good.

This revision is now accepted and ready to land.Sep 22 2019, 10:09 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2019, 10:33 AM