[llvm-dev] Is the instruction %4 = select i1 %tobool.i, metadata !12, metadata !10 legal?

Caldarale, Charles R via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 2 10:51:01 PST 2016


> From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] 
> On Behalf Of Lin, Jin via llvm-dev
> Subject: [llvm-dev] Is the instruction %4 = select i1 %tobool.i, metadata !12, metadata !10 legal?

> I wonder whether this is valid LLVM IR:
> 	%4 = select i1 %tobool.i, metadata !12, metadata !10

> Before CFGSimplify
> cond.true.i:                                      ; preds = %entry
>  %add.ptr.i = getelementptr inbounds i8, i8* %2, i64 8
>  %left_.i.i = bitcast i8* %add.ptr.i to i32**
>  %3 = call i32** @llvm.fakeload.p0p0i32(i32** %left_.i.i, metadata !8) #6  br label %_ZN1G7insert_Ev.exit
> cond.false.i:                                     ; preds = %entry
>  %right_.i.i = getelementptr inbounds i8, i8* %2, i64 16
>  %4 = bitcast i8* %right_.i.i to i32**
>  %5 = call i32** @llvm.fakeload.p0p0i32(i32** %4, metadata !11) #6
>  br label %_ZN1G7insert_Ev.exit

> After CFGSimplify
>  %4 = select i1 %tobool.i, metadata !12, metadata !10
>  %add.ptr.i = getelementptr inbounds i8, i8* %2, i64 %3
>  %left_.i.i = bitcast i8* %add.ptr.i to i32**
>  %5 = call i32** @llvm.fakeload.p0p0i32(i32** %left_.i.i, metadata %4) #6
>  %6 = load i32*, i32** %5, align 8, !tbaa !8

Is there any more to the original IR? I don't think CFGSimplify would have magically created %tobool.i, yet it doesn't appear in the provided before snippet.

 - Chuck



More information about the llvm-dev mailing list