[PATCH] [JumpThreading] Simplify comparisons when simplifying branches

Philip Reames listmail at philipreames.com
Mon Apr 27 17:08:33 PDT 2015


Hi hfinkel, nicholas, apilipenko,

If we have recognized that a conditional is constant at a particular location in the code (while trying to decide if we can simplify a conditional branch), we can eagerly replace that condition with a constant if it's definition is post dominated by the branch in question.

In practice, this ends up being a compile time savings at most. JumpThreading would have visited each using branch anyways.  CVP would have visited the cmp itself again.  Unless LVI gives up early, we shouldn't gain any addition power by doing this transformation early.  What we do gain is simplicity and compile time.

http://reviews.llvm.org/D9312

Files:
  lib/Transforms/Scalar/JumpThreading.cpp
  test/Transforms/JumpThreading/thread-cmp.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9312.24519.patch
Type: text/x-patch
Size: 3280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150428/99d3f2d8/attachment.bin>


More information about the llvm-commits mailing list