This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Fix incorrect insertion point selection for reduction nodes in ComplexDeinterleavingPass
ClosedPublic

Authored by igor.kirillov on Aug 30 2023, 8:19 AM.

Details

Summary

When replacing ComplexDeinterleavingPass::ReductionOperation, we can do it
either from the Real or Imaginary part. The correct way is to take whichever
is later in the BasicBlock, but before the patch, we just always took the
Real part.

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

Diff Detail

Event Timeline

igor.kirillov created this revision.Aug 30 2023, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 8:19 AM
igor.kirillov requested review of this revision.Aug 30 2023, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 8:19 AM
danilaml accepted this revision.Aug 30 2023, 10:29 AM

Not exactly familiar with this part of code, but the fix makes sense to me.
Perhaps we could add a check that OrderedRoots is topologically sorted under EXPENSIVE_CHECKS.

This revision is now accepted and ready to land.Aug 30 2023, 10:29 AM
This revision was landed with ongoing or failed builds.Aug 31 2023, 3:38 AM
This revision was automatically updated to reflect the committed changes.

@danilaml OrderedRoots has Instructions from the same BasicBlock, and they get there one by one during for (auto &I : *B) iteration. So, there is no risk of messing up there unless someone tries to add much more functionality :)