Page MenuHomePhabricator

Remaining TblGen patterns for extract vector element for legal types on PPC

Authored by nemanjai on Dec 9 2015, 3:16 AM.



With the introduction of VSX (P7) and subsequently direct moves (P8), we have legalized the extract vector element operation for various types. However, the TblGen patterns were not introduced to handle variable index for the element being extracted. This meant that the back end would crash when trying to match a DAG node that has the extract_vector_elt with a variable as the last operand and one of the legal types.

This patch eliminates those crashes and performs the operation with an optimal instruction sequence (avoiding stack stores and reloads).

Diff Detail


Event Timeline

nemanjai updated this revision to Diff 42283.Dec 9 2015, 3:16 AM
nemanjai retitled this revision from to Remaining TblGen patterns for extract vector element for legal types on PPC.
nemanjai updated this object.
nemanjai added reviewers: hfinkel, wschmidt, kbarton, seurer.
nemanjai set the repository for this revision to rL LLVM.
nemanjai added a subscriber: llvm-commits.
nemanjai added inline comments.Dec 9 2015, 3:19 AM

Just changed the name of this to reflect what the definition actually contains. Not all extractions are done with moves from VSRs (namely, the floating point ones).


This was a bug originally. This is meant to be a shift left by 4 bits. I don't think there was any functional impact of this bug, but I corrected it for clarity and consistency.

hfinkel accepted this revision.Dec 10 2015, 7:29 PM
hfinkel edited edge metadata.


This revision is now accepted and ready to land.Dec 10 2015, 7:29 PM
hfinkel added inline comments.Dec 10 2015, 7:33 PM

Please file a bug so we can track this; I recall seeing this in the past (and had thought it was no longer a problem, but apparently I was wrong).

nemanjai closed this revision.Dec 15 2015, 6:55 AM

Unfortunately, I made a mistake when committing the patch for:
and committed this actual patch instead (the patch landed in revision Terribly sorry for the confusion.
For D15286:
Committed revision 255649.