Don't crash when trying to constant fold a vector with some elements that can't
authorNick Lewycky <nicholas@mxc.ca>
Wed, 3 Sep 2008 05:54:33 +0000 (05:54 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 3 Sep 2008 05:54:33 +0000 (05:54 +0000)
commit83c05e5d30366d7c7e3d08e886dee89b1320ae7a
tree159bca772cbcb500a1fe373010f02b1181b5e51c
parentb388eb82fb4a95e2f6d54163dfcf962b8032bae8
Don't crash when trying to constant fold a vector with some elements that can't
be folded. Instead, fail to fold the entire vector.

We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55689 91177308-0d34-0410-b5e6-96231b3b80d8
lib/VMCore/ConstantFold.cpp
test/Transforms/InstCombine/2008-09-02-VectorCrash.ll [new file with mode: 0644]