[PATCH] D77201: [CodeGen][SelectionDAG] Flip Booleans More Often

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 02:16:42 PDT 2020


Pierre-vh created this revision.
Pierre-vh added a reviewer: dmgreen.
Herald added subscribers: llvm-commits, danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.
Pierre-vh added a parent revision: D76847: [Target][ARM] Replace re-uses of old VPR values with VPNOTs.

This change should increase the chance that something like `not(setcc)` becomes `setcc` with an opposite cond.

Note that I'm unsure about this patch, so I'll need some feedback. 
It looks fine to me, and it improves codegen in the ARM backend without affecting other backends, but I'm not sure this change is correct. 
Is this a good place for this fix, or should this fix be done in the ARM backend instead?

Example result:

  // Before the patch
  vpnot                    // VPR = !VPR
  vpsel q0, q1, q2  // q0 = VPR ? q1 : q2
  // After the patch
  vpsel q0, q2, q1 // q0 = VPR ? q2 : q1 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77201

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/Thumb2/mve-pred-or.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpf.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfr.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77201.254120.patch
Type: text/x-patch
Size: 27306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200401/0e39ff99/attachment-0001.bin>


More information about the llvm-commits mailing list