Dilan Manatunga via llvm-dev
2017-Jul-07 18:12 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
Hi, I was wondering what would be the best way to lower a select operation two predicated movs. I looked through the ARM, MIPS, and NVPTX backends and they all seem to lower a select to some sort of conditional move or native select operation. Ex. select t3, cond, t2, t1 Becomes cond mov t3, t2 !cond mov t3, t1 -Dilan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170707/a7c3db47/attachment.html>
Friedman, Eli via llvm-dev
2017-Jul-07 18:20 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
On 7/7/2017 11:12 AM, Dilan Manatunga via llvm-dev wrote:> Hi, > > I was wondering what would be the best way to lower a select operation > two predicated movs. I looked through the ARM, MIPS, and NVPTX > backends and they all seem to lower a select to some sort of > conditional move or native select operation.ARM lowers a select to a predicated mov. MOVCCr is a pseudo-instruction which gets expanded after instruction selection. -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Dilan Manatunga via llvm-dev
2017-Jul-07 19:10 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
My bad for not looking further. I'm still somewhat confused though. MOVCCr gets expanded in the ARMExpandPseudoInsts pass, and it still seems only a case of one instruction replacing the other. My worry of emitting two instructions, is that a dead code pass will eliminate the first instruction cause it thinks the second instruction is defining the same register. -Dilan On Fri, Jul 7, 2017 at 11:20 AM Friedman, Eli <efriedma at codeaurora.org> wrote:> On 7/7/2017 11:12 AM, Dilan Manatunga via llvm-dev wrote: > > Hi, > > > > I was wondering what would be the best way to lower a select operation > > two predicated movs. I looked through the ARM, MIPS, and NVPTX > > backends and they all seem to lower a select to some sort of > > conditional move or native select operation. > > ARM lowers a select to a predicated mov. MOVCCr is a pseudo-instruction > which gets expanded after instruction selection. > > -Eli > > -- > Employee of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux > Foundation Collaborative Project > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170707/7c7d2dea/attachment.html>