This is an archive of the discontinued LLVM Phabricator instance.

[asm matcher] Fix incorrect assertion when there are exactly 32 SubtargetFeatures
ClosedPublic

Authored by dsanders on May 15 2014, 2:56 AM.

Details

Summary

The minimal type needs to hold a value of '1ULL << 31' but
getMinimalTypeForRange() is called with a value of '1ULL << 32'.

This patch will also reduce the size of the matcher table when there are 8
or 16 SubtargetFeatures.

Also added a dump of the SubtargetFeatures to the -debug output and corrected getMinimalTypeInRange() to consider 0xffffffffull to be a 32-bit value.

The testcase is that no existing code is broken and that LLVM still successfully
compiles after adding MIPS64r6 CodeGen support.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 9429.May 15 2014, 2:56 AM
dsanders retitled this revision from to [asm matcher] Fix incorrect assertion when there are exactly 32 SubtargetFeatures.
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: rafael.
dsanders added a subscriber: Unknown Object (MLST).
dsanders updated this revision to Diff 9442.May 15 2014, 7:00 AM
  • Fix narrowing warnings using a strongly typed enum and correctly typed constant 1

There is now a concrete test case. D3842 is the first patch that fails to compile without this.

rafael accepted this revision.May 20 2014, 9:16 AM
rafael edited edge metadata.

LGTM with a nit.

utils/TableGen/AsmMatcherEmitter.cpp
2209

If this is the maximum used value, the assert should be <=, no?

This revision is now accepted and ready to land.May 20 2014, 9:16 AM
dsanders updated this object.May 21 2014, 3:18 AM
dsanders edited edge metadata.
dsanders closed this revision.May 21 2014, 3:18 AM

Thanks. Committed in r209288 with the nit fixed.