This is an archive of the discontinued LLVM Phabricator instance.

Fix bug with FMA Mutate and register classes
ClosedPublic

Authored by iteratee on Dec 10 2015, 11:51 AM.

Details

Reviewers
hfinkel
Summary

This was causing bad code gen and assembly that won't assemble, as
mixed altivec and vsx code would end up with a vsx high register
assigned to an altivec instruction, which won't work. Constraining the
classes allows the optimization to proceed.

Diff Detail

Event Timeline

iteratee updated this revision to Diff 42453.Dec 10 2015, 11:51 AM
iteratee retitled this revision from to Fix bug with FMA Mutate and register classes.
iteratee updated this object.
iteratee set the repository for this revision to rL LLVM.
iteratee added a subscriber: llvm-commits.
hfinkel added inline comments.
lib/Target/PowerPC/PPCVSXFMAMutate.cpp
223

Please specifically mention here that this can happen when there is a mixture of VSX and Altivec instructions, and we need to prevent assigning a virtual register with a VSX register class to an Altivec instruction.

273

Is this a drive-by cleanup or part of the fix? If the former, please commit it separately.

test/CodeGen/PowerPC/fma-mutate-register-constraint.ll
3

Remove the ModuleID line.

93

Remove any unnecessary metadata.

iteratee marked 4 inline comments as done.Dec 10 2015, 12:54 PM
iteratee added inline comments.
lib/Target/PowerPC/PPCVSXFMAMutate.cpp
273

It's part of the fix. I actually fixed this first, and it lead to using VR registers that didn't exist, so I had to add the constraint.

iteratee updated this revision to Diff 42460.Dec 10 2015, 12:55 PM
iteratee removed rL LLVM as the repository for this revision.
iteratee marked an inline comment as done.
hfinkel accepted this revision.Dec 10 2015, 1:12 PM
hfinkel added a reviewer: hfinkel.

LGTM.

This revision is now accepted and ready to land.Dec 10 2015, 1:12 PM
iteratee closed this revision.Dec 10 2015, 2:58 PM