This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix a build_vector pattern fail caused by defect in isBuildVectorAllZeros().
ClosedPublic

Authored by kevin.qin on Jun 20 2014, 3:10 AM.

Details

Reviewers
t.p.northover
Summary

Comments inside patch show the details. Please review, thanks.

Diff Detail

Event Timeline

kevin.qin updated this revision to Diff 10690.Jun 20 2014, 3:10 AM
kevin.qin retitled this revision from to [AArch64] Fix a build_vector pattern fail caused by defect in isBuildVectorAllZeros(). .
kevin.qin updated this object.
kevin.qin edited the test plan for this revision. (Show Details)
kevin.qin added a reviewer: t.p.northover.
kevin.qin set the repository for this revision to rL LLVM.
kevin.qin added a subscriber: Unknown Object (MLST).
t.p.northover edited edge metadata.Jun 23 2014, 8:11 AM

Hi Kevin,

Isn't this patch just hiding the backend issue? Enhancing isBuildVectorAllZeros like that seems like a good idea, but I can't see any guarantee that the problematic DAG can't still emerge by some other means (not that my quick tests have managed to produce it).

Cheers.

Tim.

Hi Tim,

Thanks for your review. I enhanced isBuildVectorAllZeros() according to isBuildVectorAllones() which is just above it. I think it's meaningful to get it as robust as its brother function. For the word "problematic DAG", my understanding is you're referring to the constant larger than 16 bit width which is used to build a v4i16 vector. From my point of view, I'm not sure whether it's a "problematic DAG", because after legalization, DAG combiner may generate this kind of node in many paths. It's hard to avoid generating it unless we capture all paths that may create constant folding and guarantee those foldings only happen before legalization. I can do this for the path I observed, but I can't guarantee this kind of node won't be generated from other DAG combine path. So my suggestion is don't treat that node problematic, we should get our backend correctly handle that node as well.

Regards,
Kevin Qin

Hi Kevin,

So my suggestion is don't treat that node problematic, we should get our backend correctly handle that node as well.

Agreed. That's exactly what I meant. It could come up via some other route so we need to be able to handle it.

Cheers.

Tim.

Hi Tim,

It's committed in r211567. Cheers.

Kevin.

Hi Kevin,

It's committed in r211567. Cheers.

That seems to be just the generic CodeGen improvement. What about the
actual AArch64 issue?

Cheers.

Tim.

kevin.qin updated this revision to Diff 10992.Jul 1 2014, 2:05 AM
kevin.qin edited edge metadata.

Sorry for following up this issue late. This patch is to normalize all constants building a vector. The value of constant nodes will be truncated to fit element width.

t.p.northover accepted this revision.Jul 4 2014, 4:27 AM
t.p.northover edited edge metadata.

Hi Kevin,

Thanks for the AArch64 patch. I think it looks reasonable.

Cheers.

Tim.

This revision is now accepted and ready to land.Jul 4 2014, 4:27 AM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL212428.