[LLVMdev] llvm 'select' instruction

Caldarale, Charles R Chuck.Caldarale at unisys.com
Sun Apr 14 09:14:44 PDT 2013

> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Dong Chen
> Subject: Re: [LLVMdev] llvm 'select' instruction

> but i have another question about this 'select' instruction.

There's no reason to post the same query to the list multiple times; more than once is annoying.

> i think that in LLVM IR, i can use a branch and two seperate assignments to
> replace 'select' instruction(am i right?).
> so is there any compiling option to aviod generate 'select' instruction?

Not in the standard LLVM.  We have implemented local code that avoids the generation of selects, since on some CPUs branch prediction is superior to cmov.

 - Chuck

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

More information about the llvm-dev mailing list