HomePhabricator

[GlobalISel] Simplify G_ICMP to true/false when the result is known

Authored by paquette on May 14 2021, 4:53 PM.

Description

[GlobalISel] Simplify G_ICMP to true/false when the result is known

Use existing KnownBits helpers from KnownBits.h to simplify G_ICMPs.

E.g.

x == x -> true
x != x -> false
load(x) > 1 -> true (when the load is known to be greater than 1)

And so on.

Differential Revision: https://reviews.llvm.org/D102542