This is an archive of the discontinued LLVM Phabricator instance.

Fix parsing of hex-format index dense tensor attributes.
ClosedPublic

Authored by benvanik on Oct 7 2021, 6:52 PM.

Details

Summary

TensorLiteralParser::getHexAttr does a isIntOrIndexOrFloat check and properly handles index elements, but TensorLiteralParser::getAttr that calls into it has a mismatched check. This just makes the checks match so that index element attrs can parse when of type tensor.

Diff Detail

Event Timeline

benvanik created this revision.Oct 7 2021, 6:52 PM
benvanik requested review of this revision.Oct 7 2021, 6:52 PM
rriddle accepted this revision.Oct 7 2021, 9:08 PM

LG after adding test.

This revision is now accepted and ready to land.Oct 7 2021, 9:08 PM
benvanik updated this revision to Diff 378210.Oct 8 2021, 7:38 AM

Added a test - there was nothing in this file testing the hex format at all, so I just used what I knew would trigger that path and round-trip as hex.