This is an archive of the discontinued LLVM Phabricator instance.

DAGCombiner: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))
ClosedPublic

Authored by t.p.northover on Jan 19 2015, 7:24 PM.

Details

Summary

Hi all,

I'm mostly worried about the R600 changes here. I scratched my head trying to understand just what the assembly meant, but still only have the haziest notion.

Anyway, this DAG combine is very similar to the one above it, but has different enough requirements that I've put it in a separate block. It's particularly useful for tidying up some trivial manipulations (const-masking to reconstruct a value, as seen in the R600 test actually, if I'm reading it right), especially when they're unavoidably tied to parameter passing so IR-level optimisations can't do anything.

Does it look sane?

Cheers.

Tim.

Diff Detail

Repository
rL LLVM

Event Timeline

t.p.northover retitled this revision from to DAGCombiner: fold (or (and X, M), (and X, N)) -> (and X, (or M, N)).
t.p.northover updated this object.
t.p.northover edited the test plan for this revision. (Show Details)
t.p.northover added a reviewer: arsenm.
t.p.northover set the repository for this revision to rL LLVM.
t.p.northover added a subscriber: Unknown Object (MLST).
arsenm edited edge metadata.Jan 21 2015, 1:49 PM

Evergreen tests are a huge pain to update. There aren't any sub 32-bit loads or stores, so every operation is lowered to a 32-bit operation with masking. These changes are probably fine, although for what these tests seem to really be checking they should do something else that really requires the upper bits to be zeroed.

The R600 test changes LGTM.

t.p.northover accepted this revision.Jan 21 2015, 3:19 PM
t.p.northover added a reviewer: t.p.northover.

Thanks for taking a look. I've committed this as r226740.

Tim.

This revision is now accepted and ready to land.Jan 21 2015, 3:19 PM
t.p.northover closed this revision.Jan 21 2015, 3:19 PM