This is an archive of the discontinued LLVM Phabricator instance.

Fix typing on generated LXV2DX/STXV2DX instructions
ClosedPublic

Authored by niravd on Apr 14 2016, 2:52 PM.

Details

Summary

[PPC] Previously when casting generic loads to LXV2DX/ST instructions we
would leave the original load return type in place allowing for an
assertion failure when we merge two equivalent LXV2DX nodes with
different types.

This fixes PR27350.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd updated this revision to Diff 53792.Apr 14 2016, 2:52 PM
niravd retitled this revision from to Fix typing on generated LXV2DX/STXV2DX instructions.
niravd added a reviewer: nemanjai.
niravd updated this object.
niravd added a subscriber: llvm-commits.
nemanjai edited edge metadata.Apr 14 2016, 10:59 PM
nemanjai added a subscriber: wschmidt.

Just one inline comment (actually a question for my understanding) and pending a test case, this LGTM. Perhaps @wschmidt would like to take a look as well.
I have also tested the patch with a double bootstrap build and it all works fine.

lib/Target/PowerPC/PPCISelLowering.cpp
10368 ↗(On Diff #53792)

Pardon my ignorance here, I just don't follow why we're adding this ISD::MERGE_VALUES node here.

Just one inline comment (actually a question for my understanding) and pending a test case, this LGTM. Perhaps @wschmidt would like to take a look as well.

I have nothing to add to that -- I am also unsure what that is for.

niravd updated this revision to Diff 53877.Apr 15 2016, 7:04 AM
niravd marked an inline comment as done.
niravd edited edge metadata.

Added cleaned up testcase

lib/Target/PowerPC/PPCISelLowering.cpp
10368 ↗(On Diff #53792)

Merge Value is an identity node that returns its inputs and is used to work around the fact that node replacements do not always result in a final node with constructing all the values in the correct way. Here replacing the load with a different load and a swap node was fine because they returned the same shape output (value, chain), but with the bitcast we need to make a new ephemeral node to hold the bitcast result and the swap node's chain value.

wschmidt added inline comments.Apr 15 2016, 7:15 AM
lib/Target/PowerPC/PPCISelLowering.cpp
10368 ↗(On Diff #53877)

Ah, OK, that makes sense. Perhaps add a short comment to that effect? This is uncommon enough that it will probably raise questions in the future as well.

niravd updated this revision to Diff 53882.Apr 15 2016, 7:40 AM
niravd marked an inline comment as done.

Add comment

wschmidt accepted this revision.Apr 15 2016, 7:49 AM
wschmidt added a reviewer: wschmidt.

Thanks. This LGTM!

This revision is now accepted and ready to land.Apr 15 2016, 7:49 AM
This revision was automatically updated to reflect the committed changes.

This patch causes a regression in mesa's llvmpipe driver.
The regression is detected by running piglit test suite.
The following two tests fail with this patch (and pass without it):

fbo-blending-formats GL_EXT_texture_snorm -auto -fbo
max-samplers border -auto -fbo