[llvm-commits] [llvm] r122170 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/X86/critical-edge-split-2.ll

Dan Gohman gohman at apple.com
Tue Dec 21 14:32:37 PST 2010


On Dec 20, 2010, at 6:12 PM, Chris Lattner wrote:

> On Dec 20, 2010, at 10:54 AM, Dan Gohman wrote:
>>>>> fix PR8642: if a critical edge has a PHI value that can trap,
>>>>> isel is *required* to split the edge.  PHI values get evaluated
>>>>> on the edge, not in their predecessor block.
>>>> 
>>>> What happens if the predecessor block is terminated by indirectbr, so the edge can't be split? 
>>> 
>>> Huh, good question... I don't see a really robust answer...
>> 
>> Why does LLVM need the concept of trapping constants? Prohibiting
>> them would be a robust answer, at seemingly little practical cost.
> 
> It's a good question: the only real answer that I have is that ConstantExpr::get() is our current "constant folding API".  Perhaps that's a bug, not a feature.  What do you think about eliminating div and rem as valid constant exprs?


It'd probably be ok. An alternative would be to permit div and rem
constants only when the denominator is a ConstantInt.

Dan





More information about the llvm-commits mailing list