Page MenuHomePhabricator

[PowerPC][NFC] Refactor splat of constant to vector.
ClosedPublic

Authored by anil9 on Dec 13 2019, 10:28 AM.

Details

Reviewers
hfinkel
stefanp
Group Reviewers
Restricted Project
Commits
rGec3d6f3ecb4e: [PowerPC][NFC] Refactor splat of constant to vector.
Summary

Refactor the splatting of a constant to a vector so that common code is used both for Power9 and Power8.

Diff Detail

Event Timeline

anil9 created this revision.Dec 13 2019, 10:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2019, 10:28 AM
stefanp accepted this revision as: stefanp.Dec 17 2019, 12:05 PM
stefanp added a subscriber: stefanp.

It took me a while to determine that this was in fact NFC.
Removing the whole:

if (HasAnyUndefs || ISD::isBuildVectorAllOnes(BVN)) {
...
}

threw me off.
I'm convinced now so I'll approve it.
The minor nit that I have can be done on commit.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
8642

nit:
I would like a comment here to explain that even though we are passing SplatBits which is unsigned to a function that takes a signed int for that parameter (and then that function checks to see if that value is -1 at one point) it is fine because we are only doing this for SplatSize == 1 and so we know that we are only working with 8 bits that have been zero extended.

This revision is now accepted and ready to land.Dec 17 2019, 12:05 PM
anil9 updated this revision to Diff 234372.Dec 17 2019, 1:00 PM

Addressed review comments : Added a comment.

anil9 marked an inline comment as done.Dec 17 2019, 1:05 PM
This revision was automatically updated to reflect the committed changes.