HomePhabricator

[InstSimplify] fold min/max with matching min/max operands

Authored by spatel on Aug 11 2020, 5:08 AM.

Description

[InstSimplify] fold min/max with matching min/max operands

I think this is the last remaining translation of an existing
instcombine transform for the corresponding cmp+sel idiom.

This interpretation is more general though - we can remove
mismatched signed/unsigned combinations in addition to the
more obvious cases.

min/max(X, Y) must produce X or Y as the result, so this is
just another clause in the existing transform that was already
matching a min/max of min/max.

Details

Committed
spatelAug 11 2020, 8:23 AM
Parents
rGbad205fe0c74: [InstSimplify] add tests for min/max intrinsics with common operands; NFC
Branches
Unknown
Tags
Unknown