Issue 90788
Summary [HLSL] Scalar to vector implicit conversion
Labels HLSL
Assignees
Reporter llvm-beanz
    While HLSL doesn't allow vector extension as an implicit conversion it does allow scalar to vector conversion as an implicit conversion.

```hlsl
void fn(int i) {}

void fn(vector<int64_t, 2> v) {}

export void call(int i, int64_t l, vector<int,2> vi, vector<int64_t, 2> vl) {
  fn(i);  // calls fn(int)
  fn(l);  // calls fn(vector<int64_t,2>)
  fn(vi); // calls fn(vector<int64_t,2>)
  fn(vl); // calls fn(vector<int64_t,2>)
}
```
[Compiler Explorer](https://godbolt.org/z/jqK1T8Kxr)

We need to update the language specification and implement the scalar->vector implicit conversion.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to