[LLVMdev] Instruction does not dominate all uses

Duncan Sands baldrick at free.fr
Tue Apr 16 11:01:45 PDT 2013


Hi,

On 16/04/13 17:34, Anurag kumar singh wrote:
> Hi,
> I am writing an alias profiler using the points-to relation.
> For this I'm inserting a function call of external function with the
> following type
> profile(int,int,int,void*,void*,...)
> I'm trying to pass the dereferenced pointer's memory address and the
> address of the location who are in alias set of the pointer.
>
> For this i'm using BitCastInst
> 	BitCastInst *init1= new
> BitCastInst(arg1,PointerType::getInt8PtrTy(Context),"bitcast",li2);
>
> But every time i have a dereferenced pointer inside a for loop I get an
> Instruction does not dominate all uses error.
> Instruction does not dominate all uses!
>    %9 = load i32** %x2, align 4
>    %bitcast6 = bitcast i32* %9 to i8*

this means that there is a code path from the start of the function to the
place where %bitcast6 is defined that does not first pass through the place
where %9 is defined.  This is not allowed by LLVM (SSA form).  Schematically
it might be something like this:

   if (cond)
     %9 = load i32** %x2, align 4
   %bitcast6 = bitcast i32* %9 to i8*

In this example if cond is false then you would get to %bitcast6 without %9
having been defined first.

Ciao, Duncan.

> Instruction does not dominate all uses!
>    %bitcast5 = bitcast i32* %7 to i8*
>    %newargc7 = call i32 (i32, i32, i32, i8*, i8*, ...)* @profile(i32 1,
> i32 4, i32 1, i8* %bitcast2, i8* %bitcast3, i8* %bitcast4, i8* %
> bitcast5, i8* %bitcast6)
>
> Can someone please help me ASAP
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list