Using the instruction folder to fold OpSpecConstantOp (#2598)
In order to try to reduce code duplication and to be able to fold more cases, we want to use the instruction folder when folding an OpSpecConstantOp with constant operands. A couple other changes are need to make this work. First GetDefiningInstruction| in the constant manager is able to handle |type_id| being logically equivalent to another type, so we updated the interface, and removed the assert. Some tests were also updated because we not generate better code because constants are not duplicated as much as before. No need for new tests. The functionality of the instruction folder is already tested. There are tests check that the instruction folder is being used correctly for OpCompositeExtract and OpVectorShuffle in the existing test cases. Fixes #2585.
Loading
Please register or sign in to comment