Johannes Doerfert via llvm-dev
2020-May-15 23:12 UTC
[llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch)
Hi Suresh, thanks for reporting this! I thought I fixed this with 8d94d3c3b44c3a27a69b153cef9be4b8e481150e. Did you run before or after that commit? Cheers, Johannes On 5/15/20 7:17 AM, Mani, Suresh via llvm-dev wrote:> [AMD Public Use] > > Hi , > > Please ignore the earlier header of Internal and Official use only. > > Thanks > M Suresh > > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Mani, Suresh via llvm-dev > Sent: Friday, May 15, 2020 4:37 PM > To: llvm-dev at lists.llvm.org > Subject: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) > > [CAUTION: External Email] > > [AMD Official Use Only - Internal Distribution Only] > > Hi , > > There seems to be some issue with attributor, exactly in File Attributor.cpp, Function Attributor::rewriteFunctionSignatures(), Line No: 1600 (approrimate). > > The llvm source code at above address is as follows: > > // Eliminate the instructions *after* we visited all of them. > for (auto &CallSitePair : CallSitePairs) { > CallBase &OldCB = *CallSitePair.first; > CallBase &NewCB = *CallSitePair.second; > ModifiedFns.insert(OldCB.getFunction()); > CGUpdater.replaceCallSite(OldCB, NewCB); > OldCB.replaceAllUsesWith(&NewCB); <---------------------------------------- Failing location > OldCB.eraseFromParent(); > } > > Failure symptom: > Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!" > > Snaps for IR from failing llvm IR and debug info while debugging is as follows: > > Sample situation1: > Original code in IR -- %133 = call i32 (i32, ...) bitcast (void (i32)* @set_yydebug to i32 (i32, ...)*)(i32 1) #21 > Attribute info ---- attributes #21 = { nounwind } > > Debug info: > OldCB-------------------- %133 = call i32 (i32, ...) bitcast (void (i32)* @0 to i32 (i32, ...)*)(i32 1) #27 > NewCB-------------------- call void @set_yydebug() #27 > > > OldCB.replaceAllUsesWith(&NewCB); fails because of a type mismatch b/w OldCB (i32) and NewCB (void) . > ------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > > Sample situation 2: > > Original code in IR -- %63 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @Perl_find_runcv_where to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* null) #14 > Attribute info ---- attributes #14 = { nounwind } > > Debug info: > OldCB --- %63 = tail call %struct.cv.231* @Perl_find_runcv_where(i8 zeroext 1, i64 %62) #14 > NewCB ---%64 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @15 to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* noalias align 536870912 null) #14 > > And hence OldCB.replaceAllUsesWith(&NewCB); fails > ------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > The complete IR file is very huge, and had no luck in getting a reduced test case. > > Thanks > M Suresh > > > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200515/0d6575e3/attachment.html>
Mani, Suresh via llvm-dev
2020-May-18 07:38 UTC
[llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch)
[AMD Public Use] Hi Johannes, This fix (8d94d3c3b44c3a27a69b153cef9be4b8e481150e) does not seem the resolve the issue and the problem still persists. Regards, M Suresh From: Johannes Doerfert <johannesdoerfert at gmail.com> Sent: Saturday, May 16, 2020 4:42 AM To: Mani, Suresh <Suresh.Mani at amd.com>; llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) [CAUTION: External Email] Hi Suresh, thanks for reporting this! I thought I fixed this with 8d94d3c3b44c3a27a69b153cef9be4b8e481150e. Did you run before or after that commit? Cheers, Johannes On 5/15/20 7:17 AM, Mani, Suresh via llvm-dev wrote: [AMD Public Use] Hi , Please ignore the earlier header of Internal and Official use only. Thanks M Suresh From: llvm-dev <llvm-dev-bounces at lists.llvm.org><mailto:llvm-dev-bounces at lists.llvm.org> On Behalf Of Mani, Suresh via llvm-dev Sent: Friday, May 15, 2020 4:37 PM To: llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> Subject: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) [CAUTION: External Email] [AMD Official Use Only - Internal Distribution Only] Hi , There seems to be some issue with attributor, exactly in File Attributor.cpp, Function Attributor::rewriteFunctionSignatures(), Line No: 1600 (approrimate). The llvm source code at above address is as follows: // Eliminate the instructions *after* we visited all of them. for (auto &CallSitePair : CallSitePairs) { CallBase &OldCB = *CallSitePair.first; CallBase &NewCB = *CallSitePair.second; ModifiedFns.insert(OldCB.getFunction()); CGUpdater.replaceCallSite(OldCB, NewCB); OldCB.replaceAllUsesWith(&NewCB); <---------------------------------------- Failing location OldCB.eraseFromParent(); } Failure symptom: Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!" Snaps for IR from failing llvm IR and debug info while debugging is as follows: Sample situation1: Original code in IR -- %133 = call i32 (i32, ...) bitcast (void (i32)* @set_yydebug to i32 (i32, ...)*)(i32 1) #21 Attribute info ---- attributes #21 = { nounwind } Debug info: OldCB-------------------- %133 = call i32 (i32, ...) bitcast (void (i32)* @0 to i32 (i32, ...)*)(i32 1) #27 NewCB-------------------- call void @set_yydebug() #27 OldCB.replaceAllUsesWith(&NewCB); fails because of a type mismatch b/w OldCB (i32) and NewCB (void) . ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sample situation 2: Original code in IR -- %63 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @Perl_find_runcv_where to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* null) #14 Attribute info ---- attributes #14 = { nounwind } Debug info: OldCB --- %63 = tail call %struct.cv.231* @Perl_find_runcv_where(i8 zeroext 1, i64 %62) #14 NewCB ---%64 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @15 to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* noalias align 536870912 null) #14 And hence OldCB.replaceAllUsesWith(&NewCB); fails ------------------------------------------------------------------------------------------------------------------------------------------------------------------ The complete IR file is very huge, and had no luck in getting a reduced test case. Thanks M Suresh _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev&data=02%7C01%7CSuresh.Mani%40amd.com%7C3ec51ab5f31d4532def708d7f92592d3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637251812084831564&sdata=TH8RFgAGR8Y7ajpinztVmy7b4fffIYd7NmXiEEW19Vo%3D&reserved=0> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200518/9b0f9b4e/attachment.html>
Mani, Suresh via llvm-dev
2020-May-18 09:31 UTC
[llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch)
[AMD Public Use] Hi Johannes, I took the latest llvm code now and the issue got resolved. Thanks M Suresh From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Mani, Suresh via llvm-dev Sent: Monday, May 18, 2020 1:09 PM To: Johannes Doerfert <johannesdoerfert at gmail.com>; llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) [CAUTION: External Email] [AMD Public Use] Hi Johannes, This fix (8d94d3c3b44c3a27a69b153cef9be4b8e481150e) does not seem the resolve the issue and the problem still persists. Regards, M Suresh From: Johannes Doerfert <johannesdoerfert at gmail.com<mailto:johannesdoerfert at gmail.com>> Sent: Saturday, May 16, 2020 4:42 AM To: Mani, Suresh <Suresh.Mani at amd.com<mailto:Suresh.Mani at amd.com>>; llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) [CAUTION: External Email] Hi Suresh, thanks for reporting this! I thought I fixed this with 8d94d3c3b44c3a27a69b153cef9be4b8e481150e. Did you run before or after that commit? Cheers, Johannes On 5/15/20 7:17 AM, Mani, Suresh via llvm-dev wrote: [AMD Public Use] Hi , Please ignore the earlier header of Internal and Official use only. Thanks M Suresh From: llvm-dev <llvm-dev-bounces at lists.llvm.org><mailto:llvm-dev-bounces at lists.llvm.org> On Behalf Of Mani, Suresh via llvm-dev Sent: Friday, May 15, 2020 4:37 PM To: llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> Subject: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch) [CAUTION: External Email] [AMD Official Use Only - Internal Distribution Only] Hi , There seems to be some issue with attributor, exactly in File Attributor.cpp, Function Attributor::rewriteFunctionSignatures(), Line No: 1600 (approrimate). The llvm source code at above address is as follows: // Eliminate the instructions *after* we visited all of them. for (auto &CallSitePair : CallSitePairs) { CallBase &OldCB = *CallSitePair.first; CallBase &NewCB = *CallSitePair.second; ModifiedFns.insert(OldCB.getFunction()); CGUpdater.replaceCallSite(OldCB, NewCB); OldCB.replaceAllUsesWith(&NewCB); <---------------------------------------- Failing location OldCB.eraseFromParent(); } Failure symptom: Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!" Snaps for IR from failing llvm IR and debug info while debugging is as follows: Sample situation1: Original code in IR -- %133 = call i32 (i32, ...) bitcast (void (i32)* @set_yydebug to i32 (i32, ...)*)(i32 1) #21 Attribute info ---- attributes #21 = { nounwind } Debug info: OldCB-------------------- %133 = call i32 (i32, ...) bitcast (void (i32)* @0 to i32 (i32, ...)*)(i32 1) #27 NewCB-------------------- call void @set_yydebug() #27 OldCB.replaceAllUsesWith(&NewCB); fails because of a type mismatch b/w OldCB (i32) and NewCB (void) . ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sample situation 2: Original code in IR -- %63 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @Perl_find_runcv_where to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* null) #14 Attribute info ---- attributes #14 = { nounwind } Debug info: OldCB --- %63 = tail call %struct.cv.231* @Perl_find_runcv_where(i8 zeroext 1, i64 %62) #14 NewCB ---%64 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @15 to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* noalias align 536870912 null) #14 And hence OldCB.replaceAllUsesWith(&NewCB); fails ------------------------------------------------------------------------------------------------------------------------------------------------------------------ The complete IR file is very huge, and had no luck in getting a reduced test case. Thanks M Suresh _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev&data=02%7C01%7CSuresh.Mani%40amd.com%7Cd4cdbdbb0c2c4270067508d7fafe9287%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637253843596533796&sdata=W57Y5UXf2uKqX4OpANNxiV1Mv9ArtYxnxPkFjSUbS90%3D&reserved=0> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200518/f2153e0b/attachment.html>