This is an archive of the discontinued LLVM Phabricator instance.

[LV] Fix crash when optimized phi is feeding first-order recurrence.
AbandonedPublic

Authored by fhahn on Nov 29 2021, 9:44 AM.

Details

Reviewers
Ayal
gilr
Summary

This patch fixes a crash when a phi with an optimized cast feeds a
first-order recurrence, as discussed in D113183.

There are 2 issues that this patch addresses:

  1. The recipe for the optimized cast is not recorded.
  2. fixHeaderPhis assumes the incoming def defines a single VPValue.

If the incoming value is an induction phi recipe, always use the first
defined value, which represents the phi itself.

Diff Detail

Unit TestsFailed

Event Timeline

fhahn created this revision.Nov 29 2021, 9:44 AM
fhahn requested review of this revision.Nov 29 2021, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2021, 9:44 AM
Herald added a subscriber: vkmr. · View Herald Transcript
fhahn abandoned this revision.Dec 5 2021, 5:04 AM

Removing of dead casts can be done directly in VPlan, so there's no need for special handling of induction recipes: D115112