[llvm-commits] [llvm] r55689 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Transforms/InstCombine/2008-09-02-VectorCrash.ll

Nick Lewycky nicholas at mxc.ca
Tue Sep 2 23:46:41 PDT 2008


Nick Lewycky wrote:
> Author: nicholas
> Date: Wed Sep  3 00:54:33 2008
> New Revision: 55689
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=55689&view=rev
> Log:
> 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!

I've been mulling this over, and I realized that if we don't fold each 
element, we can end up with two vectors:

   sitofp(<i8 0, sdiv(i8 1, i8 0)>)

and

   <float 0, sitofp(sdiv(i8 1, i8 0))>

that are equivalent but not shared by structural equivalence. I'll fix 
that shortly.

Nick




More information about the llvm-commits mailing list