|
@@ -909,6 +909,15 @@ OP::OP(LLVMContext &Ctx, Module *pModule)
|
|
|
|
|
|
Type *Int4Types[4] = { Type::getInt32Ty(m_Ctx), Type::getInt32Ty(m_Ctx), Type::getInt32Ty(m_Ctx), Type::getInt32Ty(m_Ctx) }; // HiHi, HiLo, LoHi, LoLo
|
|
|
m_pInt4Type = GetOrCreateStructType(m_Ctx, Int4Types, "dx.types.fouri32", pModule);
|
|
|
+
|
|
|
+ // When loading a module into an existing context where types are merged,
|
|
|
+ // type names may change. When this happens, any intrinsics overloaded on
|
|
|
+ // UDT types will no longer have matching overload names.
|
|
|
+ // This causes RefreshCache() to assert.
|
|
|
+ // This fixes the function names to they match the expected types,
|
|
|
+ // preventing RefreshCache() from failing due to this issue.
|
|
|
+ FixOverloadNames();
|
|
|
+
|
|
|
// Try to find existing intrinsic function.
|
|
|
RefreshCache();
|
|
|
}
|