Refusing to store single element

Hi all,

I’m hitting the following assert in PredicateSimplifier.cpp:961 :

assert(!CR.isSingleElement() && “Refusing to store single element.”);

If I ignore it the generated code appears correct so I’m not sure what this assert is supposed to be for. Am I doing something wrong on my end or is this a superfluous assert or it really indicates an LLVM bug?

The code I’m generating is fairly long but if necessary I could try to boil it down…

Cheers,

Nicolas

I'm hitting the following assert in PredicateSimplifier.cpp:961 :

An assert in PredicateSimplifier is probably a bug in the
-predsimplify pass; it's still considered experimental.

The code I'm generating is fairly long but if necessary I could try to boil
it down…

See http://llvm.org/docs/HowToSubmitABug.html; there are automated
tools to boil down large testcases.

-Eli

I'm hitting the following assert in PredicateSimplifier.cpp:961 :

Hi Nicolas,

The predsimplify pass is experimental at best, and should be removed at worst. I don't think it is going to be futher developed, so I'd suggest staying away from it.

-Chris

assert(!CR.isSingleElement() && "Refusing to store single element.");

If I ignore it the generated code appears correct so I'm not sure what this
assert is supposed to be for. Am I doing something wrong on my end or is
this a superfluous assert or it really indicates an LLVM bug?

The code I'm generating is fairly long but if necessary I could try to boil
it down.

Cheers,

Nicolas

-Chris

Chris Lattner wrote:

I'm hitting the following assert in PredicateSimplifier.cpp:961 :

Hi Nicolas,

The predsimplify pass is experimental at best, and should be removed at worst. I don't think it is going to be futher developed, so I'd suggest staying away from it.

I believe it's on by default for VMKit. Whether it should be is a different matter altogether.

The assert means that predsimplify has encountered what should be an impossible state; a value range has collapsed to a single constant number, but instead of replacing the Value with the new constant, it's just storing the fact that it's equal to said constant without performing any replacement. A missed optimization, really.

If you can simplify it with "bugpoint -predsimplify yourcode.bc" then I can take a look at what's wrong and fix it.

Nick