[llvm-commits] [llvm] r132732 - /llvm/trunk/utils/TableGen/FastISelEmitter.cpp

Bob Wilson bob.wilson at apple.com
Fri Jun 10 12:17:28 PDT 2011


On Jun 10, 2011, at 12:05 PM, David Blaikie wrote:
> Ah, ok - thanks for the explanation. I didn't realize llvm_unreachable was that advanced/involved (though I suppose I Should've expected as much). 
> 
> So both versions (the assert & the unreachable) seem to have similar semantics (performance & correctness) given a sufficiently advanced compiler (that uses the unreachable to remove the isFP() call) - makes sense.
> 
> [is there any policy/recommendations on which way to go in this case? I guess it's not a problem to leave this up to the author of any particular piece of LLVM code about which expression they prefer/find more clear in a given situation]

If I remember correctly, Chris has expressed a strong opinion to use assert instead of llvm_unreachable.  I can't find the message where he said that, so hopefully I'm not misremembering.

Maybe we should add something about that to the LLVM Coding Standards?  I have noticed llvm_unreachable being used quite a bit lately, so I don't think the message is clear.



More information about the llvm-commits mailing list