Skip to content

[mono] Always store to allocas in OP_LLVM_OUTARG_VT - #64303

Merged
imhameed merged 2 commits into
dotnet:mainfrom
imhameed:mono-llvm-update-memory-mirror
Jan 27, 2022
Merged

imhameed merged 2 commits into
dotnet:mainfrom
imhameed:mono-llvm-update-memory-mirror

Conversation

@imhameed

Copy link
Copy Markdown
Contributor

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.

@ghost ghost assigned imhameed Jan 25, 2022
@imhameed imhameed added the runtime-mono specific to the Mono runtime label Jan 25, 2022
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.
@imhameed
imhameed force-pushed the mono-llvm-update-memory-mirror branch from 0b4a806 to a36763f Compare January 26, 2022 00:34
@vargaz

vargaz commented Jan 26, 2022

Copy link
Copy Markdown
Contributor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@imhameed
imhameed merged commit cfd15d5 into dotnet:main Jan 27, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Codegen-LLVM-mono runtime-mono specific to the Mono runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants