[InstCombine] Do not insert a GEP instruction before a landingpad instruction.
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Feb 2015 03:30:11 +0000 (03:30 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Feb 2015 03:30:11 +0000 (03:30 +0000)
commit1defd5afbd4f86ba3dcfb564002eb3cf964efa3b
tree553db21a6eec5bcf136daf4cc902bdd20a1a5efb
parent4393559621a3b2784086ba4d30be635426d2da31
[InstCombine] Do not insert a GEP instruction before a landingpad instruction.

InstCombiner::visitGetElementPtrInst was using getFirstNonPHI to compute the
insertion point, which caused the verifier to complain when a GEP was inserted
before a landingpad instruction. This commit fixes it to use getFirstInsertionPt
instead.

rdar://problem/19394964

llvm-svn: 229619
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/gepphigep.ll