[PATCH] Select elimination pass

Gerolf Hoflehner ghoflehner at apple.com
Tue Sep 2 12:46:05 PDT 2014


Hi echristo,

In special cases select instructions can be eliminated by
replacing them with a cheaper bitwise operation. The instance implemented
by this pass is %x=icmp.eq; %y=select %x,%r, null; %z=icmp.eq %y, null;
br %z,true, false ==> %x=icmp.ne; %y=icmp.eq %r,null; %z=or %x,%y; br
%z,true,false. The optimization is global and performed only when all uses
of the select result can be replaced by the select true value. For this
dominator information is used.

http://reviews.llvm.org/D5156

Files:
  bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
  include/llvm-c/Transforms/Scalar.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  lib/LTO/LTOCodeGenerator.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/Scalar.cpp
  lib/Transforms/Scalar/SelectElimination.cpp
  test/Transforms/SelectElim/
  test/Transforms/SelectElim/select-elim-or.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5156.13178.patch
Type: text/x-patch
Size: 14608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140902/8a8f18f5/attachment.bin>


More information about the llvm-commits mailing list