Dilan Manatunga via llvm-dev
2017-Jul-07 20:34 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
Ohh, that makes sense. And is the reason the first instruction doesn't get deleted because the ExpandPseudoInstructions pass occurs after Register Allocation and machine dead code elimination? -Dilan On Fri, Jul 7, 2017 at 12:37 PM Friedman, Eli <efriedma at codeaurora.org> wrote:> On 7/7/2017 12:10 PM, Dilan Manatunga wrote: > > 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. > > The output of MOVCCr is tied to the "false" input using RegConstraint. > The register allocator puts the "false" value into the destination > register, then MOVCCr gets expanded to a predicated MOVr which moves the > "true" value into the destination register. > > -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/81e38105/attachment.html>
Friedman, Eli via llvm-dev
2017-Jul-07 21:32 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
On 7/7/2017 1:34 PM, Dilan Manatunga wrote:> Ohh, that makes sense. And is the reason the first instruction doesn't > get deleted because the ExpandPseudoInstructions pass occurs after > Register Allocation and machine dead code elimination?That's how it works right now, yes, but it's a bug, not the intended design. (Post-RA scheduling runs after ExpandPseudoInstructions, so we need accurate dependencies; I'm surprised we haven't seen any miscompiles.) The correct way to represent the dependency is with an implicit use. See UpdatePredRedefs in IfConversion.cpp for an example. -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 23:48 UTC
[llvm-dev] Lowering Select to Two Predicated Movs
Cool, that all made sense. Thanks for the help and the useful code examples. Cleared things up. -Dilan On Fri, Jul 7, 2017 at 2:32 PM Friedman, Eli <efriedma at codeaurora.org> wrote:> On 7/7/2017 1:34 PM, Dilan Manatunga wrote: > > Ohh, that makes sense. And is the reason the first instruction doesn't > > get deleted because the ExpandPseudoInstructions pass occurs after > > Register Allocation and machine dead code elimination? > > That's how it works right now, yes, but it's a bug, not the intended > design. (Post-RA scheduling runs after ExpandPseudoInstructions, so we > need accurate dependencies; I'm surprised we haven't seen any miscompiles.) > > The correct way to represent the dependency is with an implicit use. > See UpdatePredRedefs in IfConversion.cpp for an example. > > -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/d6566a20/attachment.html>