[PATCH] D29265: [legalize-types] Remove stale entries from SoftenedFloats.

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 07:35:11 PST 2017


sepavloff added a comment.

Just a discussion about approach, as we both worked on the same problem :)

It looks like all these arrays, `PromotedIntegers`, `SoftededFloats` etc are in fact parts of one array that contains mapping of nodes to their replacement, they differ only by operation that created the replacement. They are useful only for error checking, otherwise their separate existence is useless.  If it is true, we could have only one array, `ReplacedValues` that contained all such replacements. For the sake of checking we could keep few bits along with the replacement (in the form of PointerIntPair for instance) and check them when the replacement node is extracted or updated. Such checks would be cheap, they do not require search in tables, and they could be enabled in regular debug builds.

I have feeling that implementation of the legalizer is overcomplicated, and if we get rid of separate arrays for replacement nodes, the legalizer will become more clear and, may be, faster.

What do you think about such solution?


https://reviews.llvm.org/D29265





More information about the llvm-commits mailing list