This is an archive of the discontinued LLVM Phabricator instance.

[ARM][CGP] Allow signext arguments
ClosedPublic

Authored by samparker on Sep 25 2019, 6:32 AM.

Details

Summary

As we perform a zext on any arguments used in the promoted tree, it doesn't matter if they're marked as signext. The only permitted user(s) in the tree which would interpret the sign bits are signed icmps. For these instructions, their promoted operands are truncated before the icmp uses them.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker created this revision.Sep 25 2019, 6:32 AM

Obviously ignoring the attribute is correct; signext is just an ABI attribute which has no semantic effect at the IR level. But why was the code to check it added in https://reviews.llvm.org/D61381? I assume it was supposed to be some sort of profitability check.

We had a bug involving SIToFP and then I got worried about the signext arg in the reproducer too, as I had just forgotten that we explicitly zext any arguments used. Adding some profitability checks are on my todo list though.

This revision is now accepted and ready to land.Sep 26 2019, 1:08 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2019, 12:50 AM