This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Properly update insertion point of the builder
AbandonedPublic

Authored by danilaml on Aug 29 2023, 10:58 AM.

Details

Summary

Other code assumes that it can use passed Builder parameter to
generate new instructions but this code path created its own IRBuilder
instance, leaving the passed builder with an old insertion point.

Fixes https://github.com/llvm/llvm-project/issues/65044

Diff Detail

Event Timeline

danilaml created this revision.Aug 29 2023, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 10:58 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
danilaml requested review of this revision.Aug 29 2023, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 10:58 AM
danilaml added inline comments.Aug 29 2023, 10:59 AM
llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
1955

Not sure if it's the good/proper place to fix it, but at least it ensures that callers of replaceNode will insert their instructions after it.

igor.kirillov added inline comments.Aug 30 2023, 8:21 AM
llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
1955

It's a good idea, but unfortunately, this won't work out because Builder.GetInsertPoint() might be from a different block than InsertPoint. I added a review with a fix - https://reviews.llvm.org/D159209

danilaml abandoned this revision.Aug 30 2023, 10:08 AM

Superseded by D159209

danilaml marked an inline comment as done.Aug 30 2023, 10:28 AM