This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Refactor IR generation functions to use IRBuilder in ComplexDeinterleaving pass
ClosedPublic

Authored by igor.kirillov on Apr 19 2023, 3:27 AM.

Details

Summary

This patch updates several functions in LLVM's IR generation code to accept
an IRBuilder object as an argument, rather than an Instruction that indicates
the insertion point for new instructions.
This change is necessary to handle sophisticated -Ofast optimization cases
from D148558 where it's unclear which instructions should be used as the
insertion point for new operations.

Depends on D148550

Diff Detail

Event Timeline

igor.kirillov created this revision.Apr 19 2023, 3:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 3:27 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
igor.kirillov requested review of this revision.Apr 19 2023, 3:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 3:27 AM
NickGuy accepted this revision.May 25 2023, 6:56 AM

LGTM

llvm/test/CodeGen/AArch64/complex-deinterleaving-mixed-cases.ll
222–228

Any idea what caused these changes? Is it solely down to using a single IRBuilder instance? Or is there some element of non-determinism with regards to the ordering at this point?

This revision is now accepted and ready to land.May 25 2023, 6:56 AM
igor.kirillov added inline comments.May 25 2023, 7:10 AM
llvm/test/CodeGen/AArch64/complex-deinterleaving-mixed-cases.ll
222–228

While building a new tree consisting of fcmla/fcadd/symmetric from predecessors to successors, it does it without paying attention where the original instructions were. So it caused some irrelevant changes in the order.
It should be deterministic - everything we iterate there uses deterministic structures and maps/sets are only for checking