rust/src/librustc_codegen_ssa/traits
Xiang Fan f71e0daa29 Add llvm.sideeffect to potential infinite loops and recursions
LLVM assumes that a thread will eventually cause side effect. This is
not true in Rust if a loop or recursion does nothing in its body,
causing undefined behavior even in common cases like `loop {}`.
Inserting llvm.sideeffect fixes the undefined behavior.

As a micro-optimization, only insert llvm.sideeffect when jumping back
in blocks or calling a function.

A patch for LLVM is expected to allow empty non-terminate code by
default and fix this issue from LLVM side.

https://github.com/rust-lang/rust/issues/28728
2019-09-28 04:45:08 +08:00
..
abi.rs removes AbiMethods 2019-05-14 21:23:01 +05:30
asm.rs Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm} 2019-08-17 09:12:32 +01:00
backend.rs Remove tx_to_llvm_workers from TyCtxt 2019-09-25 16:57:27 -04:00
builder.rs codegen: be more explicit about setting giving names to allocas. 2019-09-12 19:04:30 +03:00
consts.rs CTFE: simplify Value type by not checking for alignment 2019-08-02 23:02:53 +02:00
debuginfo.rs rustc_codegen_llvm: give names to non-alloca variable values. 2019-09-06 16:57:20 +03:00
declare.rs remove reexport of rustc::ty::Instance 2019-06-02 22:32:42 -05:00
intrinsic.rs Add llvm.sideeffect to potential infinite loops and recursions 2019-09-28 04:45:08 +08:00
misc.rs remove reexports of mir::mono::{MonoItem,CodegenUnit} 2019-06-02 22:50:03 -05:00
mod.rs rustc_codegen_*: deny(unused_lifetimes). 2019-06-11 14:11:58 +03:00
statics.rs Remove LocalInternedString uses from librustc_codegen_llvm. 2019-09-04 14:23:45 +10:00
type_.rs Rename sty to kind 2019-09-25 15:50:04 +01:00
write.rs Replace TimeLine with SelfProfiler 2019-03-10 11:10:55 -04:00