about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-13 10:54:55 -0700
committerGitHub <noreply@github.com>2016-09-13 10:54:55 -0700
commit2fd060815f9e9c4ae787cb1cd44df51aeb91fe6e (patch)
tree46160807d18246a754f2f1de12680e467a7c8b25 /src/libsyntax/parse
parentc87ba3f1222ba20d491e8ed76a04977283280742 (diff)
parentb778f7fa0192ac6863f3ce0ab49d9c4001bf5503 (diff)
downloadrust-2fd060815f9e9c4ae787cb1cd44df51aeb91fe6e.tar.gz
rust-2fd060815f9e9c4ae787cb1cd44df51aeb91fe6e.zip
Auto merge of #36181 - seanmonstar:likely, r=nikomatsakis
core: add likely and unlikely intrinsics

I'm no good at reading assembly, but I have tried a stage1 compiler with this patch, and it does cause different asm output. Additionally, testing this compiler on my httparse crate with some `likely` usage added in to the branches does affect benchmarks. However, I'm sure a codegen test should be included, if anyone knows what it should look like.

There isn't an entry in `librustc_trans/context.rs` in this diff, because it already exists (`llvm.expect.i1` is used for array indices).

----

Even though this does affect httparse benchmarks, it doesn't seem to affect it the same way GCC's `__builtin_expect` affects picohttpparser. I was confused that the deviation on the benchmarks grew hugely when testing this, especially since I'm absolutely certain that the branchs where I added `likely` were always `true`. I chalk that up to GCC and LLVM handle branch prediction differently.

cc #26179
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions