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

Chris Lattner clattner at apple.com
Mon Dec 20 18:12:24 PST 2010


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?

-Chris



More information about the llvm-commits mailing list