This repository was archived by the owner on Feb 5, 2019. It is now read-only.
[X86] Fix Windows i1 zeroext
conventions to use i8 instead of i32
#119
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.
On Windows, the call convention for e.g. bools on x86 is to pass them as 8-bit values, which, when using registers, means using the narrowed registers (as in cl instead of ecx/rcx), so callers may just set the lower bits when passing a bool. But a rust function that receives a bool uses the entire 32/64-bits register, and may get stale bits in the non-flushed high bits, changing the meaning of the boolean value.
This probably doesn't affect rust to rust calls because llvm emits code that resets the upper bits, but it does affect ffi calls to rust, such that building Firefox with rustc > 1.24 breaks WebRender on Windows (somehow, only on debug builds). See https://bugzilla.mozilla.org/show_bug.cgi?id=1471497#c7. Who knows what else this subtly breaks.
This is a backport of llvm-mirror/llvm@ff1d4d2 .
The change to existing tests were to parts that don't exist in llvm 6.0, except for h-registers-0.ll, which is somehow unmodified (actually, it's more surprising that it needed a change on trunk).
I built llvm locally and ran all tests, with only a failure in
TargetLibraryInfoTest.ValidProto
related to the__rust_*alloc
functions.