The `BooleanConditionOrMatchingShape` trait was assuming that if the condition was not i1, both condition and result must be `ShapedTypes`. It would then call `AllShapesMatch` which performs a blind cast to `ShapedType`, causing a crash when one of the operands was a scalar. This PATCH fixes the problem. Closes [#178230](https://github.com/llvm/llvm-project/issues/178230)