[TensorExpr] Fix IRPrinter for function calls with uniqued names (#39753)
Summary:
IRPrinter was using the name_hint rather than the uniqued name when printing FunctionCalls, leading to output that appeared incorrect.
E.g. for the following set of tensorexprs:
```
producer[M, N] = M * N;
chunk[M, N/2] = producer[M, N];
chunk_1[M, N/2] = producer[M, N + N/2];
consumer[M, N] = chunk_1[M, N];
```
Before fix:
```
{
for (int m = 0; m < 4; m++) {
for (int n = 0; n < 20; n++) {
producer[m, n] = m * n;
}
}
for (int m_1 = 0; m_1 < 4; m_1++) {
for (int n_1 = 0; n_1 < 10; n_1++) {
chunk[m_1, n_1] = producer(m_1, n_1);
}
}
for (int m_2 = 0; m_2 < 4; m_2++) {
for (int n_2 = 0; n_2 < 10; n_2++) {
chunk_1[m_2, n_2] = producer(m_2, n_2 + 10);
}
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 10; j++) {
consumer[i, j] = i * (chunk(i, j)); <----- HERE!
}
}
}
```
After fix:
```
{
for (int m = 0; m < 4; m++) {
for (int n = 0; n < 20; n++) {
producer[m, n] = m * n;
}
}
for (int m_1 = 0; m_1 < 4; m_1++) {
for (int n_1 = 0; n_1 < 10; n_1++) {
chunk[m_1, n_1] = producer(m_1, n_1);
}
}
for (int m_2 = 0; m_2 < 4; m_2++) {
for (int n_2 = 0; n_2 < 10; n_2++) {
chunk_1[m_2, n_2] = producer(m_2, n_2 + 10);
}
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 10; j++) {
consumer[i, j] = i * (chunk_1(i, j)); <----- HERE!
}
}
}
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39753
Differential Revision: D21962441
Pulled By: nickgg
fbshipit-source-id: caa429caf0df9c7b16e109937412587bff6dc886