[LLVMdev] About user of bitcast/GEP instruction

Hal Finkel hfinkel at anl.gov
Fri Jan 30 03:55:52 PST 2015


----- Original Message -----
> From: "guoqing zhang" <gqzhang81 at gmail.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Friday, January 30, 2015 4:29:16 AM
> Subject: [LLVMdev] About user of bitcast/GEP instruction
> 
> Hi,
> 
> 
> In PromoteMemoryToRegister.cpp, it seems to rely on the fact that the
> only users of bitcast/GEP instruction are lifetime intrinsics
> (llvm.lifetime.start/end).

You're misreading that code. There is special handling is that pass for looking through those instructions to find lifetime intrinsics, but that's all.

> I did some searching in llvm/test folder,
> it seems to be true.
> 

bitcasts and GEPs are general-purpose instructions. GEPs are most often used by loads/stores. Look at test/Transforms/LoopReroll/basic.ll for an example with lots of them. test/Analysis/BasicAA/gep-alias.ll is another place to look.

> 
> However, by reading LLVM IR manual, I don't see any restriction
> stated on the possible user of bitcast/GEP instruction. So my
> question is who impose the restriction ? Is it Clang ?

There is definitely no such restriction.

 -Hal

> 
> 
> Regards
> -guoqing
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list