[llvm-dev] Lowering Select to Two Predicated Movs

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 7 14:32:12 PDT 2017


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



More information about the llvm-dev mailing list