Page MenuHomePhabricator

[LiveRangeCalc] Fixed findReachingDefs bug
Needs ReviewPublic

Authored by tpr on Sep 1 2018, 3:15 PM.

Details

Summary

findReachingDefs was incorrectly using its fast path of just blitting in
the live range extension when it did not see an undef itself but
encountered an undef live out of a predecessor block.

Now RegisterCoalescing calls extendToIndices (D49097), the bug was
causing an incorrect subrange which led to a "Couldn't join subrange!"
assert in a later coalesce.

Change-Id: I01c942b41ab5a145348289c8b221c45a2ec7200f

Diff Detail

Event Timeline

tpr created this revision.Sep 1 2018, 3:15 PM

Hi Tim,

The change itself looks good to me, but the testcase is not specific enough to bring value. In particular, we shouldn't require to build with assert to see the problem/correct behavior.

Cheers,
-Quentin

test/CodeGen/AMDGPU/regcoalescer-assert-from-incorrect-subrange-extension.mir
2

Could you check that the coalescing does the right thing instead of just checking that we emit a function?

52

At this point I don't think the frameInfo is relevant.
Could you rip it off?

Tip: You can use -simplify-mir when you create your .mir file to get rid of this kind of cruft.

arsenm added a subscriber: arsenm.Nov 13 2018, 3:07 PM

This testcase works as-is without the patch