Skip to content

[InstCombine] Should we canonicalize max(min(x, C1), C2) to min(max(x, C2), C1) #121870

Closed
@bcl5980

Description

@bcl5980

We have some common pattern like max(min(x, -128),127) to quantize a value to int8_t in AI.
And these two patterns should be the same: max(min(x, -128),127), min(max(x, -128), 127)
Maybe we can add a pattern for it?

https://alive2.llvm.org/ce/z/WjmAjz

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions