llvm-project
8ebbb20d - [HLSL] Add an lvalue to rvalue cast when appropriate for HLSLElementwiseCast and HLSLAggregateSplatCast (#163828)

Commit
93 days ago
[HLSL] Add an lvalue to rvalue cast when appropriate for HLSLElementwiseCast and HLSLAggregateSplatCast (#163828) When the Sub expression of an HLSLAggregateSplatCast is an LValue insert an LValue to RValue cast; done using DefaultLvalueConversion. When the Sub expression of an HLSLElementwiseCast is an LValue and not a record or an array insert an LValue to RValue cast. Arrays were already handled correctly using an HLSLArrayRValue cast. DefaultLvalueConversion is used to add the LValue to RValue cast when appropriate and does not emit one when the expression is a record. Update existing test which was broken by this change. Add two new tests for HLSLElementwiseCast showing the lack of lvalue to rvalue cast for a struct and showing the lvalue to rvalue cast for a vector. Closes #163593
Author
Parents
Loading