Mingming Liu via llvm-dev
2021-Nov-18 17:14 UTC
[llvm-dev] Strip IR metadata information in a unit test
Hi, When modifying IR for the purpose of a unit test (e.g., in https://github.com/llvm/llvm-project/tree/main/llvm/test/Transforms/SROA), the IR generated by OPT may have metadata that's not used by the tested pass. Are there some general suggestions on how to strip metadata? Is this mostly empirical by analyzing how the metadata takes effect in the e2e compiling process (i.e., outside of one pass)? Any form of pointers / related threads in the past would be enlightening! From this perspective stripping unused metadata manually could be error prone (e.g., for a more complex IR, or a test IR consisting of 10+ functions). -- Thanks, Mingming -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211118/aaf069d7/attachment-0001.html>
Philip Reames via llvm-dev
2021-Nov-18 17:23 UTC
[llvm-dev] Strip IR metadata information in a unit test
See llvm-reduce. Philip On 11/18/21 9:14 AM, Mingming Liu via llvm-dev wrote:> Hi, > > When modifying IR for the purpose of a unit test (e.g., in > https://github.com/llvm/llvm-project/tree/main/llvm/test/Transforms/SROA > <https://github.com/llvm/llvm-project/tree/main/llvm/test/Transforms/SROA>), > the IR generated by OPT may have metadata that's not used by the > tested pass. > > Are there some general suggestions on how to strip metadata? Is > this mostly empirical by analyzing how the metadata takes effect in > the e2e compiling process (i.e., outside of one pass)? Any form of > pointers / related threads in the past would be enlightening! > > From this perspective stripping unused metadata manually could be > error prone (e.g., for a more complex IR, or a test IR consisting of > 10+ functions). > > -- > Thanks, > Mingming > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211118/98b1a059/attachment.html>