[SimplifyIndVar] Do not fail when we constant fold an IV user to ConstantPointerNull
authorHongbin Zheng <etherzhhb@gmail.com>
Fri, 29 Sep 2017 16:32:12 +0000 (16:32 +0000)
committerHongbin Zheng <etherzhhb@gmail.com>
Fri, 29 Sep 2017 16:32:12 +0000 (16:32 +0000)
commitc8abdf5f2509067052e5845d3d8a0e21020f628a
treeb3d7372733104c0e88404b5d0904d49f9c939e30
parentc2e79c2dfc07e1aba27946f22ea370cd5c130b04
[SimplifyIndVar] Do not fail when we constant fold an IV user to ConstantPointerNull

The type of a SCEVConstant may not match the corresponding LLVM Value.
In this case, we skip the constant folding for now.

TODO: Replace ConstantInt Zero by ConstantPointerNull
llvm-svn: 314531
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
llvm/test/Transforms/IndVarSimplify/constant-fold-1.ll [new file with mode: 0644]
llvm/test/Transforms/IndVarSimplify/constant-fold.ll