HomePhabricator

[TableGen] Reduce the number of map lookups in TypeSetByHwMode::getOrCreate.

Authored by craig.topper on Thu, Apr 15, 12:24 PM.

Description

[TableGen] Reduce the number of map lookups in TypeSetByHwMode::getOrCreate. NFCI

hasMode was looking up the map once. Then we'd either call get which
would look up again, or we'd insert into the map which requires
walking the map to find the insertion point.

I believe the hasMode was needed because get has a special case
to look for DefaultMode if the mode being asked for doesn't exist.
We don't want that here so we were using hasMode to make sure we
wouldn't hit that case.

Simplify to a regular operator[] access which will default
construct a SetType if the lookup fails.

Details

Committed
craig.topperThu, Apr 15, 12:32 PM
Parents
rG13015ebd6f56: [AMDGPU] Factor out predicate FmaakFmamkF32Insts
Branches
Unknown
Tags
Unknown