[llvm-commits] [llvm] r107071 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp lib/VMCore/Value.cpp test/Analysis/BasicAA/unreachable-block.ll

Eli Friedman eli.friedman at gmail.com
Tue Jun 29 00:36:21 PDT 2010


On Tue, Jun 29, 2010 at 12:09 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Dan,
>
>> +define void @func_2() nounwind {
>> +entry:
>> +  unreachable
>> +
>> +bb:
>> +  %t = select i1 undef, i32* %t, i32* undef
>> +  %p = select i1 undef, i32* %p, i32* %p
>> +  %q = select i1 undef, i32* undef, i32* %p
>> +  %a = getelementptr i8* %a, i32 0
>> +  unreachable
>> +}
>
> is this IR really valid?  Wouldn't it be better to have the verifier
> reject it?

The current rule is that instructions in basic blocks which can't be
reached according to the CFG don't trigger anything like dominance
rules.  One reason is that it would be tricky to define in more
complex cases...

-Eli




More information about the llvm-commits mailing list