@@ -778,7 +778,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
778778 Intrinsic::lifetime_start : Intrinsic::invariant_start;
779779 auto Args = F->getFunctionType ()->params ();
780780 Type* ObjectPtr[1 ] = {Args[1 ]};
781- if (F->getName () != Intrinsic::getName (ID, ObjectPtr)) {
781+ if (F->getName () != Intrinsic::getName (ID, ObjectPtr, F-> getParent () )) {
782782 rename (F);
783783 NewFn = Intrinsic::getDeclaration (F->getParent (), ID, ObjectPtr);
784784 return true ;
@@ -792,7 +792,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
792792
793793 auto Args = F->getFunctionType ()->params ();
794794 Type* ObjectPtr[1 ] = {Args[IsLifetimeEnd ? 1 : 2 ]};
795- if (F->getName () != Intrinsic::getName (ID, ObjectPtr)) {
795+ if (F->getName () != Intrinsic::getName (ID, ObjectPtr, F-> getParent () )) {
796796 rename (F);
797797 NewFn = Intrinsic::getDeclaration (F->getParent (), ID, ObjectPtr);
798798 return true ;
@@ -814,7 +814,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
814814 case ' m' : {
815815 if (Name.startswith (" masked.load." )) {
816816 Type *Tys[] = { F->getReturnType (), F->arg_begin ()->getType () };
817- if (F->getName () != Intrinsic::getName (Intrinsic::masked_load, Tys)) {
817+ if (F->getName () !=
818+ Intrinsic::getName (Intrinsic::masked_load, Tys, F->getParent ())) {
818819 rename (F);
819820 NewFn = Intrinsic::getDeclaration (F->getParent (),
820821 Intrinsic::masked_load,
@@ -825,7 +826,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
825826 if (Name.startswith (" masked.store." )) {
826827 auto Args = F->getFunctionType ()->params ();
827828 Type *Tys[] = { Args[0 ], Args[1 ] };
828- if (F->getName () != Intrinsic::getName (Intrinsic::masked_store, Tys)) {
829+ if (F->getName () !=
830+ Intrinsic::getName (Intrinsic::masked_store, Tys, F->getParent ())) {
829831 rename (F);
830832 NewFn = Intrinsic::getDeclaration (F->getParent (),
831833 Intrinsic::masked_store,
@@ -837,7 +839,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
837839 // to the new overload which includes an address space
838840 if (Name.startswith (" masked.gather." )) {
839841 Type *Tys[] = {F->getReturnType (), F->arg_begin ()->getType ()};
840- if (F->getName () != Intrinsic::getName (Intrinsic::masked_gather, Tys)) {
842+ if (F->getName () !=
843+ Intrinsic::getName (Intrinsic::masked_gather, Tys, F->getParent ())) {
841844 rename (F);
842845 NewFn = Intrinsic::getDeclaration (F->getParent (),
843846 Intrinsic::masked_gather, Tys);
@@ -847,7 +850,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
847850 if (Name.startswith (" masked.scatter." )) {
848851 auto Args = F->getFunctionType ()->params ();
849852 Type *Tys[] = {Args[0 ], Args[1 ]};
850- if (F->getName () != Intrinsic::getName (Intrinsic::masked_scatter, Tys)) {
853+ if (F->getName () !=
854+ Intrinsic::getName (Intrinsic::masked_scatter, Tys, F->getParent ())) {
851855 rename (F);
852856 NewFn = Intrinsic::getDeclaration (F->getParent (),
853857 Intrinsic::masked_scatter, Tys);
@@ -928,7 +932,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
928932 if (Name.startswith (" objectsize." )) {
929933 Type *Tys[2 ] = { F->getReturnType (), F->arg_begin ()->getType () };
930934 if (F->arg_size () == 2 || F->arg_size () == 3 ||
931- F->getName () != Intrinsic::getName (Intrinsic::objectsize, Tys)) {
935+ F->getName () !=
936+ Intrinsic::getName (Intrinsic::objectsize, Tys, F->getParent ())) {
932937 rename (F);
933938 NewFn = Intrinsic::getDeclaration (F->getParent (), Intrinsic::objectsize,
934939 Tys);
@@ -941,7 +946,8 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
941946 if (Name == " prefetch" ) {
942947 // Handle address space overloading.
943948 Type *Tys[] = {F->arg_begin ()->getType ()};
944- if (F->getName () != Intrinsic::getName (Intrinsic::prefetch, Tys)) {
949+ if (F->getName () !=
950+ Intrinsic::getName (Intrinsic::prefetch, Tys, F->getParent ())) {
945951 rename (F);
946952 NewFn =
947953 Intrinsic::getDeclaration (F->getParent (), Intrinsic::prefetch, Tys);
0 commit comments