[PATCH] D29711: [globalisel] Sort RuleMatchers by priority.
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 01:01:15 PST 2017
dsanders added inline comments.
================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:224-230
+ // Wider types should have priority over narrower types within the same
+ // family but the order of the families doesn't matter. So s64 is more
+ // important than s32 and f64 is more important than f32 but s64 and f64 are
+ // unordered.
+ // FIXME: Don't do a lexical comparison of the type name. Check the size
+ // instead. This only works for the cases we emit so far and is only
+ // done this way because we can't delve into LLT's yet.
----------------
ab wrote:
> Huh, how can this be a problem?
It works fine for s32 and s64 since "s32" < "s64" but the overall ordering is wrong when the number of digits vary:
"s128" < "s16" < "s32" < "s64" < "s8"
Once I've dealt with the LLT layering issue we'll be able to do a numeric comparison for the size such that the order is:
s8 < s16 < s32 < s64 < s128
https://reviews.llvm.org/D29711
More information about the llvm-commits
mailing list