[PATCH] D118478: [Local] invertCondition: try modifying an existing ICmpInst

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 08:03:49 PST 2022


foad created this revision.
foad added reviewers: ekatz, sameerds, tsymalla, nhaehnle, arsenm, rampitec.
Herald added subscribers: kerbowa, hiraditya, tpr, jvesely.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

This avoids various cases where StructurizeCFG would otherwise insert an
xor i1 instruction, and it since it generally runs late in the pipeline,
instcombine does not clean the xor-of-cmp pattern.

TODO: update remaining AMDGPU tests by hand:

  LLVM :: CodeGen/AMDGPU/branch-relaxation.ll
  LLVM :: CodeGen/AMDGPU/loop_break.ll
  LLVM :: CodeGen/AMDGPU/multi-divergent-exit-region.ll
  LLVM :: CodeGen/AMDGPU/multilevel-break.ll
  LLVM :: CodeGen/AMDGPU/nested-loop-conditions.ll
  LLVM :: CodeGen/AMDGPU/optimize-negated-cond.ll
  LLVM :: CodeGen/AMDGPU/ret_jump.ll
  LLVM :: CodeGen/AMDGPU/sgpr-copy.ll
  LLVM :: CodeGen/AMDGPU/wave32.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118478

Files:
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/divergent-control-flow.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
  llvm/test/CodeGen/AMDGPU/ctpop16.ll
  llvm/test/CodeGen/AMDGPU/insert_vector_elt.ll
  llvm/test/CodeGen/AMDGPU/sgpr-control-flow.ll
  llvm/test/Transforms/StructurizeCFG/AMDGPU/loop-subregion-misordered.ll
  llvm/test/Transforms/StructurizeCFG/bug36015.ll
  llvm/test/Transforms/StructurizeCFG/invert-constantexpr.ll
  llvm/test/Transforms/StructurizeCFG/one-loop-multiple-backedges.ll
  llvm/test/Transforms/StructurizeCFG/post-order-traversal-bug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118478.404029.patch
Type: text/x-patch
Size: 24938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220128/950416bb/attachment-0001.bin>


More information about the llvm-commits mailing list