Ensure that we don't try to constant fold BSF(0) or BSR(0)#81516
Ensure that we don't try to constant fold BSF(0) or BSR(0)#81516tannergooding merged 4 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThis resolves #81460 Even with the qmark, we'd end up getting something like: So even though the The fix is to simply bail out if the constant is zero.
|
|
There is potentially something here to be handled in the future in that we are doing VN on things which are "dead". If we had some minimal early constant propagation or similar, we could avoid doing VN/CSE/folding or other potentially expensive things for code that will just be dropped in one of the next few phases. |
|
Brought in latest main to pickup the CI fix |
This resolves #81460
Even with the qmark
(x == 0) ? 31 : BSR(x), we'd end up getting something like:So even though the
BSF(0)/BSR(0)is dead code, we don't know it yet and it leads to VN trying to fold and therefore triggering the assert.The fix is to simply bail out if the constant is zero.