[mono] Always store to allocas in OP_LLVM_OUTARG_VT #64303
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OP_LLVM_OUTARG_VT will, for some argument passing conventions, create an
alloca and mirror its source SSA value into this alloca. If such an
OP_LLVM_OUTARG_VT is first encountered in a basic block that does not
contain the definition of the SSA value being mirrored, then sibling
basic blocks (e.g. a loop body that may sometimes be skipped) can use
garbage data if they also have OP_LLVM_OUTARG_VT opcodes referring to
the same SSA values.
This commit works around this by unconditionally storing the source
OP_LLVM_OUTARG_VT value into its associated alloca. The resulting IR
would be a little easier to read if we eagerly stored to an alloca
mirror exactly once at each value's definition, but that would require
more work to implement.
Fixes JIT/SIMD/VectorExp_ro/VectorExp_ro. See #64179.