Don't skip debug instructions when looking for the insertion point of
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 18 Feb 2012 17:22:58 +0000 (17:22 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 18 Feb 2012 17:22:58 +0000 (17:22 +0000)
commitef4c80e07baf02dd2a8f08db49c5634a06d3ca1e
treefeba556fcdc7f9ccd182ed4fbe3206947cd5c625
parent31d157ae1ac2cd9c787dc3c1d28e64c682803844
Don't skip debug instructions when looking for the insertion point of
the cast. If we do, we can end up with

   inst1
   ---------------  < Insertion point
   dbg inst
   new inst

instead of the desired

   inst1
   new inst
   ---------------  < Insertion point
   dbg inst

Another option would be for InsertNoopCastOfTo (or its callers) to move the
insertion point and we would end up with

   inst1
   dbg inst
   new inst
   ---------------  < Insertion point

but that complicates the callers. This fixes PR12018 (and firefox's build).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150884 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp
test/Transforms/LoopStrengthReduce/pr12018.ll [new file with mode: 0644]