Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick a number of fixes #163

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

nikic
Copy link

@nikic nikic commented Jan 9, 2024

fhahn and others added 5 commits January 9, 2024 12:09
Add ad test case where `bl OUTLINED_FUNCTION_0` clobbers LR, which in
turn is used the later call to memcpy to return to the caller.

(cherry picked from commit 20f634f)
…lvm#75527)

emitPopInst checks a single function exit MBB. If other paths also exit
the function and any of there terminators uses LR implicitly, it is not
save to clear the Restored bit.

Check all terminators for the function before clearing Restored.

This fixes a mis-compile in outlined-fn-may-clobber-lr-in-caller.ll
where the machine-outliner previously introduced BLs that clobbered LR
which in turn is used by the tail call return.

Alternative to llvm#73553

(cherry picked from commit b1a5ee1)
Sometimes, we create a MemoryAccess for an instruction, which is later
simplified (e.g. via devirtualization) such that the new instruction has
no memory effects anymore.

If we later clone the instruction (e.g. during unswitching), then MSSA
will not create a MemoryAccess for the new instruction, triggering an
assert.

Disable the assertion (by passing CreationMustSucceed=false) and adjust
getDefiningAccessForClone() to work correctly in that case.

This PR implements the alternative suggestion by alinas from
llvm#76142.

(cherry picked from commit d02c793)
(cherry picked from commit 1ff9fb7)
(cherry picked from commit 3dd2db0)
(cherry picked from commit 836e71a)
Functions using different constant expressions were incorrectly
merged, because a lot of state was missing from the comparison,
including the opcode, the comparison predicate, the GEP element
type, as well as the inbounds, inrange and nowrap poison flags.

(cherry picked from commit 8b8f2ef)
@cuviper cuviper merged commit 700fbf9 into rust-lang:rustc/17.0-2023-12-14 Jan 9, 2024
vext01 pushed a commit to vext01/llvm-project that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants