Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc: Update LLVM #26025
Conversation
rust-highfive
assigned
pcwalton
Jun 5, 2015
This comment has been minimized.
This comment has been minimized.
|
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
r? @brson cc @rust-lang/compiler - something to be aware of at least, and I may have updated something horribly incorrectly |
rust-highfive
assigned
brson
and unassigned
pcwalton
Jun 5, 2015
pnkfelix
referenced this pull request
Jun 5, 2015
Merged
Replace zeroing-on-drop with filling-on-drop. #23535
This comment has been minimized.
This comment has been minimized.
|
@eddyb notes on a comment from #23535 that we may want to restrict the |
This comment has been minimized.
This comment has been minimized.
|
Apparently, LLVM PR23763 is fixed now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton oh, of course, I forgot that. Maybe that machinery should be moved out of |
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
fc88c8b
to
bd572c7
Jun 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Looks like rust-lang/llvm@47dfcb7 did indeed fix the problems I was seeing! Updated the LLVM submodule. |
brson
reviewed
Jun 5, 2015
| unwrap(PMB)->SLPVectorize = SLPVectorize; | ||
| unwrap(PMB)->OptLevel = OptLevel; | ||
| unwrap(PMB)->LoopVectorize = LoopVectorize; | ||
| #endif | ||
| } |
This comment has been minimized.
This comment has been minimized.
brson
Jun 5, 2015
Contributor
Now that the PMB opt level is set here and not through llvm::LLVMPassManagerBuilderSetOptLevel it appears that for LLVM < 7 we don't set the PMB opt level. Is that true, and is that bad?
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 5, 2015
Author
Member
Oh this reminded me that I meant to recompile these files against 3.5 and 3.6, and now having done so it looks like only MergeFunctions wasn't available in 3.5 but everything else is now set on all versions.
brson
reviewed
Jun 5, 2015
| #if LLVM_VERSION_MINOR <= 6 | ||
| context | ||
| #endif | ||
| ))); | ||
| #else |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 5, 2015
Author
Member
Yeah this file is... a mess. Supporting multiple LLVM versions is definitely not our forte.
brson
reviewed
Jun 5, 2015
| @@ -46,7 +46,7 @@ pub fn small_array_alignment(x: [i8; 4]) -> [i8; 4] { | |||
| // dependent alignment | |||
| #[no_mangle] | |||
| pub fn small_struct_alignment(x: Bytes) -> Bytes { | |||
| // CHECK: [[VAR:%[0-9]+]] = load i32* %{{.*}}, align 1 | |||
| // CHECK: [[VAR:%[0-9]+]] = load i32, i32* %{{.*}}, align 1 | |||
| // CHECK: ret i32 [[VAR]] | |||
| x | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eddyb
Jun 5, 2015
Member
LLVM is switching to opaque pointers, so instructions working with pointers have to supply both the pointer type and the pointee in the interim.
The final result will have only the pointee type, the pointer type always being ptr or something like that.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 5, 2015
Author
Member
Yeah this was just changes syntactically in the IR self, semantically nothing changed here.
This comment has been minimized.
This comment has been minimized.
|
r=me once you've answered my q's. This was a tough upgrade. Good work. |
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
bd572c7
to
0e0cc9e
Jun 5, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 5, 2015
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
0e0cc9e
to
89cb355
Jun 6, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 6, 2015
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
This is now blocked on https://llvm.org/bugs/show_bug.cgi?id=23779 |
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
89cb355
to
c59700b
Jun 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Ok, the LLVM bug has not been fixed yet, and I had some time to do some more investigation. The end result was adding this extra commit to the LLVM branch that we're using. Still running tests locally, but I suspect it will fix that segfault at least. re-r? @brson |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Do you think you could fix this error before trying again?
|
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
6583dda
to
547418d
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
547418d
to
78ac14c
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:update-llvm
branch
from
78ac14c
to
f9d4149
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
bors
merged commit f9d4149
into
rust-lang:master
Jun 17, 2015
alexcrichton
deleted the
alexcrichton:update-llvm
branch
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
KindDragon
commented
Jun 17, 2015
|
Congratulations! |
alexcrichton
referenced this pull request
Jun 18, 2015
Closed
MSVC: Implement 32-bit Unwinding #25869
dotdash
referenced this pull request
Jun 18, 2015
Closed
Performance of inlined code not as expected #24489
gz
referenced this pull request
Jun 20, 2015
Open
Compiling libcore without SSE leads to LLVM ERROR: SSE register return with SSE disabled #26449
pnkfelix
referenced this pull request
Jul 9, 2015
Closed
Using both --enable-debug, --enable-optimization causes an assertion failure on build #26484
This comment has been minimized.
This comment has been minimized.
|
This caused a regression related to LLVM passes. I fixed it in #31176 |
alexcrichton commentedJun 5, 2015
This commit updates the LLVM submodule in use to the current HEAD of the LLVM
repository. This is primarily being done to start picking up unwinding support
for MSVC, which is currently unimplemented in the revision of LLVM we are using.
Along the way a few changes had to be made:
significant changes to our RustWrapper.cpp
ensure that we're doing the same thing as clang.
PassManagerBuilderinstead of through CLI switches to LLVM.NoFramePointerElimoption was removed from LLVM, favoring instead theno-frame-pointer-elimfunction attribute instead.LoopVectorizeoption of the LLVM optimization passes has been disabledas it causes a divide-by-zero exception to happen in LLVM for zero-sized
types. This is reported as https://llvm.org/bugs/show_bug.cgi?id=23763
Additionally, LLVM has picked up some new optimizations which required fixing an
existing soundness hole in the IR we generate. It appears that the current LLVM
we use does not expose this hole. When an enum is moved, the previous slot in
memory is overwritten with a bit pattern corresponding to "dropped". When the
drop glue for this slot is run, however, the switch on the discriminant can
often start executing the
unreachableblock of the switch due to thediscriminant now being outside the normal range. This was patched over locally
for now by having the
unreachableblock just change to aret void.