Page MenuHomePhabricator

[DAGCombiner] Replace gathers with a zero mask with the passthru value
ClosedPublic

Authored by bkramer on May 29 2019, 11:22 AM.

Details

Summary

These can be created by the legalizer when splitting a larger gather.
Also make isNullOrNullSplat a bit smarter by ignoring truncation in
BUILD_VECTORs.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer created this revision.May 29 2019, 11:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2019, 11:22 AM
craig.topper added inline comments.May 29 2019, 11:30 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
8092 ↗(On Diff #201999)

I wonder if we should just use ISD::isBuildVectorAllZeros here.

llvm/test/CodeGen/AArch64/vecreduce-bool.ll
100 ↗(On Diff #201999)

I assume this was caused by the isNullOrNullSplat change?

bkramer updated this revision to Diff 202009.May 29 2019, 11:41 AM

Use isBuildVectorAllZeros, drop isNullOrNullSplat change.

bkramer marked 4 inline comments as done.May 29 2019, 11:42 AM
bkramer added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
8092 ↗(On Diff #201999)

That's indeed simpler. Why do we have so many of these things? :(

llvm/test/CodeGen/AArch64/vecreduce-bool.ll
100 ↗(On Diff #201999)

Yeah. It's a minor improvement. But I dropped this for now.

This revision is now accepted and ready to land.May 29 2019, 12:11 PM
This revision was automatically updated to reflect the committed changes.