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

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 17:07:45 PDT 2021


paquette created this revision.
paquette added reviewers: aemerson, arsenm.
Herald added subscribers: kerbowa, hiraditya, rovka, nhaehnle, jvesely.
paquette requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D102542

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/test/CodeGen/AArch64/GlobalISel/prelegalizer-combiner-icmp-to-true-false-known-bits.mir
  llvm/test/CodeGen/AArch64/fold-global-offsets.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/cvt_f32_ubyte.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/saddsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/ssubsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll



More information about the llvm-commits mailing list