[llvm] [AArch64][GlobalISel] FP Info implementation for AArch64. (PR #177158)

Ryan Cowan via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 08:15:12 PST 2026


HolyMolyCowMan wrote:

In the version of the match table changes I included in https://github.com/llvm/llvm-project/pull/155107,  `GIM_SwitchType` had been modified to try matching the value as various types to hopefully find one that fits the given type range. This is because the match table previously sorted types in an enum and made use of their indices for this purpose. This meant that a pattern could have been looking for an i64, but because the given operand made use of an s64 it wouldn't match due to the type ID falling out of bounds.

I realised that making these changes to `GIM_SwitchType` was not enough for most patterns as `GIM_CheckType` amongst others would still fail. There was also the risk that the wrong patterns might have been matched.

I have instead added a new match table opcode that explicitly checks for a field defined for each opcode, that specifies whether to use the generic types for matching. This way, we can also rewrite the tablegen patterns themselves to use generic types allowing `GIM_CheckType` etc to match properly.

When I did this, it broke the way that the match table grouped together patterns. The tablesize ballooned. By allowing `SwitchMatcher` to store multiple matchers, we can circumvent the problems of building these groups greedily by allowing more matchers per group and thus reusing more `SwitchType`/`SwitchTypeShape` checks. In doing this I found that the tablesize could be reduced further by optimizing each of these buckets, hoisting checks.

https://github.com/llvm/llvm-project/pull/177158


More information about the llvm-commits mailing list