M1 mac LLVM bug for tensor multiplication 
@SuryanarayanaY 
I was able to reproduce the issue on Mac M1 using tf 2.11. Please find the below screenshot for reference:
<img width="565" alt="Screenshot 2023-04-12 at 3 12 54 PM" src="https://user-images.githubusercontent.com/111861663/231423500-0dd0eafd-f081-4000-9d01-34a7190b2539.png">
I was able to execute the code without error on colab using tf2.11 and tf2.12. Please find the gist of [tf2.11](https://colab.research.google.com/gist/tiruk007/c1366ad9bf92608d71a884b46bfc58a0/untitled187.ipynb) and [tf2.12](https://colab.research.google.com/gist/tiruk007/069354340b8af5dfd3f5751b263c23de/untitled188.ipynb) for reference.

Thank you !
 @AlbertoSinigaglia ,

I have explicitly tried the code with `Colab` on CPU and GPU by using tf.device() and it works fine for both.Reference [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/b260d9fb9990274e679cab1de774685d/60281.ipynb).

When tried the code on Mac by with `tf.device('CPU')` the code works fine and the problem raises when used `tf.device('GPU')`. Please refer the attached logs below.

[60281_mac_logs.txt](https://github.com/tensorflow/tensorflow/files/11210566/60281_mac_logs.txt)


This seems to be issue specific to `tensorflow-macos` which is maintained by Apple it self. Request you to file an issue there also and mostly should be addressed by them.Efforts from our side also will be in place to collaborate with Apple team to resolve the issue.

Thanks! > @AlbertoSinigaglia ,
> 
> I have explicitly tried the code with `Colab` on CPU and GPU by using tf.device() and it works fine for both.Reference [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/b260d9fb9990274e679cab1de774685d/60281.ipynb).
> 
> When tried the code on Mac by with `tf.device('CPU')` the code works fine and the problem raises when used `tf.device('GPU')`. Please refer the attached logs below.
> 
> [60281_mac_logs.txt](https://github.com/tensorflow/tensorflow/files/11210566/60281_mac_logs.txt)
> 
> This seems to be issue specific to `tensorflow-macos` which is maintained by Apple it self. Request you to file an issue there also and mostly should be addressed by them.Efforts from our side also will be in place to collaborate with Apple team to resolve the issue.
> 
> Thanks!

Will do that, even though I have already many pending requests to Apple, with no answer since months... @nitins17 , Could you please have a look and confirm whether any pointers here?

CC: @learning-to-play  Hi,

The issue seems to be resolved with the latest Tensorflow version.

You can now install Tensorflow package on M1 from 2.13 using pip install Tensorflow.

Below is the command to install Tensorflow package, once it is installed, code mentioned in the issue runs without any error.

!pip install tensorflow==2.13rc1 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60281">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60281">No</a>

### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

2.8.0, 2.11

### Custom Code

No

### OS Platform and Distribution

MaxOS 12.3.1 

### Python version

3.9, 3.10

### GPU model and memory

M1 Max 26 cores GPU 32 GB ram

### Current Behaviour?

```shell
For some reason, it does not allow me to matrix multiply those 2 tensors (on M1, Colab works just fine)
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np
class EncoderBlock(tf.keras.layers.Layer):
    def __init__(self,**kwargs):
        super().__init__(**kwargs)
        self.n_heads = 2
    def build(self, input_shape):
        self.WQ = self.add_weight("WQ_encoder", (self.n_heads, input_shape[-1], 10))
        # however, an easy fix is the using the following:
        # self.WQ = self.add_weight("WQ_encoder", (1, self.n_heads, input_shape[-1], 10))
        # but clearly there is a problem, as the broadcast should take place nicely like on Colab
    def call(self, inputs, mask, *args):
        inputs = inputs[:,None,...]
        _ = tf.matmul(inputs,self.WQ)
        # ^^^^^^^^^^^^^^^^^^^^^^^^^^^

EncoderBlock()(np.random.randn(3,10,13), np.ones((3,10)))
```


### Relevant log output

```shell
-:5:10: error: incompatible dimensions
-:5:10: error: invalid shape
LLVM ERROR: Failed to infer result type(s).
```