Make sure the constant folder get the correct type.
There are a few locations where we need to handle duplicate types. We cannot merge them because they may be needed for reflection. When this happens we need do some extra lookups in the type manager. The specific fixes are: 1) When generating a constant through `GetDefiningInstruction` accept and use an id for the desired type of the constant. This will make sure you get the type that is needed. 2) In Private-to-local, make sure we to update the def-use chains when a new pointer type is created. 3) In the type manager, make sure that `FindPointerToType` returns a pointer that points to the given type and not a duplicate type. 4) In scalar replacment, make sure the null constants that are created are the correct type.
Loading
Please register or sign in to comment