[PATCH] Fix PR22222

Sanjoy Das sanjoy at playingwithpointers.com
Wed Jan 14 14:38:55 PST 2015


Hi majnemer, hfinkel, atrick,

The bug was introduced in r225282.  r225282 assumed that `sub X, Y` is the same as `add X, -Y`.  This is not correct if we are going to upgrade the sub to `sub nuw`.  This change fixes the issue by making the optimization ignore `sub` instructions.

http://reviews.llvm.org/D6979

Files:
  lib/Transforms/Utils/SimplifyIndVar.cpp
  test/Transforms/IndVarSimplify/pr22222.ll
  test/Transforms/IndVarSimplify/strengthen-overflow.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6979.18186.patch
Type: text/x-patch
Size: 6062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150114/89a08d8c/attachment.bin>


More information about the llvm-commits mailing list