Issue 163593
Summary [HLSL] Missing LValue to RValue cast in implicit cast for HLSLAggregateSplatCast
Labels HLSL
Assignees
Reporter spall
    The HLSLAggregateSplatCast allows for splatting from a vec1.  In the case we are splatting from a vec1 instead of a scalar an implicit cast is inserted to truncate the vec1 to a scalar.  
```
int1 A = {1};
int4 B = (int4)A;
```
In this example there is a missing LValue to RValue cast, so the truncation is resulting in an LValue. But before the HLSLVectorTruncation there should be an LValue to RValue cast.
```
-CStyleCastExpr 0x193fb1c0 <col:15, col:23> 'float4':'vector<float, 4>' <HLSLAggregateSplatCast>
  | `-ImplicitCastExpr 0x193fb1a8 <col:23> 'float' lvalue <HLSLVectorTruncation> part_of_explicit_cast
  |       `-DeclRefExpr 0x193fb170 <col:23> 'float1':'vector<float, 1>' lvalue ParmVar 0x193faec8 'I4' 'float1':'vector<float, 1>'
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to