No, sorry, I made some typos in my question. I meant to ask For the instructions generated by LLVM for one particular function, is it possible to have duplicated instructions? Thanks On Wed, 14 Dec 2011, Duncan Sands wrote:> Hi Jane, > >> Hi, are the assembly instructions generated by LLVM for each function (and >> not just for each BasicBlock) unique? Thanks. > > are you asking if LLVM merges identical functions? It does not (it does have > an optional IR level pass for doing this though). > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
On 14/12/11 17:29, Jane Ren wrote:> No, sorry, I made some typos in my question. I meant to ask > > For the instructions generated by LLVM for one particular function, is it > possible to have duplicated instructions?I'm not sure what you are asking. If you look at the assembler for all but the simplest function you will see the same assembler instructions occurring several times. For example "xorl %esi, %esi" is pretty popular. Ciao, Duncan.> > Thanks > > On Wed, 14 Dec 2011, Duncan Sands wrote: > >> Hi Jane, >> >>> Hi, are the assembly instructions generated by LLVM for each function (and >>> not just for each BasicBlock) unique? Thanks. >> >> are you asking if LLVM merges identical functions? It does not (it does have >> an optional IR level pass for doing this though). >> >> Ciao, Duncan. >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>
> I'm not sure what you are asking. If you look at the assembler for all > but the simplest function you will see the same assembler instructions > occurring several times. For example "xorl %esi, %esi" is pretty > popular. > > Ciao, Duncan.Perhaps he want to ask if those duplicated instructions will be optimized out by LLVM or not. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj