This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix verifier error in SIFoldOperands
ClosedPublic

Authored by arsenm on Oct 9 2015, 12:56 PM.

Details

Reviewers
tstellarAMD
Summary

There may be other use operands that also need their kill flags cleared.

This happens in a few tests when SIFoldOperands is moved after
PeepholeOptimizer.

PeepholeOptimizer rewrites cases that look like:
%vreg0 = ...
%vreg1 = COPY %vreg0
use %vreg1<kill>
%vreg2 = COPY %vreg0
use %vreg2<kill>

to use the earlier source to
%vreg0 = ...
use %vreg0
use %vreg0

Currently SIFoldOperands sees the copied registers, so there is
only one use. So far I haven't managed to come up with a test
that currently has multiple uses of a foldable VGPR -> VGPR copy.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 36979.Oct 9 2015, 12:56 PM
arsenm retitled this revision from to AMDGPU: Fix verifier error in SIFoldOperands.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Oct 20 2015, 3:19 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 20 2015, 3:19 PM
arsenm closed this revision.Oct 21 2015, 3:40 PM

r250960