Conversation
Are you saying that LLVM's |
|
Expect with probability seems to affect |
|
When there is no expected value nor probability, wouldn't a name like |
|
For purposes of consistency with C (compiler |
|
I don't want likely as it implies an unlikely. Note that the only real purpose of this builtin is the unlikely version, and unlikely is a bit ugly imo. I will change it up to accept a second field for true or false instead and keep expect as per @kprotty suggestion when we talked about it. |
|
Since the user can implement a likely or unlikely pretty easily themselves when a second field is added: I think this would be the best solution. Thanks! :) |
|
Should |
|
Thought about that yesterday, but I think making |
clickingbuttons
left a comment
There was a problem hiding this comment.
What about a nice sugary @expect(operand: anytype, expected: anytype) and add a check for @typeOf(operand) == @typeOf(expected)?
|
Reverted in 9be8a90. I would like a chance to review this please. |
This reverts commit a7de02e. This did not implement the accepted proposal, and I did not sign off on the changes. I would like a chance to review this, please.

closes #489
Why
@expecttakes a bool:@expectaffects branching codegen and you can only branch on a bool.unreachablewith respect to the optimizer.Why
@expectdoesn't have a probability: