Uh oh!
There was an error while loading. Please reload this page.
Avoid some bounds checks in binary_heap::{PeekMut,Hole} - #58123
Conversation
rust-highfive
commented
Feb 3, 2019
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
commented
Feb 3, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
ed675f9 to
ca7c8a9Comparerust-highfive
commented
Feb 3, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
ca7c8a9 to
1b29a03Compare1b29a03 to
ea72066Comparetest code use std::collections::BinaryHeap;#[no_mangle]pubexternfnis_opt(heap:&mutBinaryHeap<u32>) -> bool{ifletSome(mut peek) = heap.peek_mut(){*peek = 1;true}else{false}}before Details .text .file "peekmut.71651wce-cgu.0" .section .text._ZN4core3ptr18real_drop_in_place17hb6242b27b5771784E,"ax",@progbits .p2align 4,0x90 .type _ZN4core3ptr18real_drop_in_place17hb6242b27b5771784E,@function_ZN4core3ptr18real_drop_in_place17hb6242b27b5771784E: .cfi_startproc pushq %rax .cfi_def_cfa_offset 16 cmpb$0,8(%rdi)je .LBB0_12movq (%rdi), %raxmovq16(%rax), %r9 testq %r9, %r9je .LBB0_13movq (%rax), %rax movl (%rax), %r8d cmpq$1, %r9jne .LBB0_4 xorl %esi, %esijmp .LBB0_11.LBB0_4: movl$1, %edi xorl %ecx, %ecx .p2align 4,0x90.LBB0_5: leaq 1(%rdi), %rsi cmpq %r9, %rsijae .LBB0_8 movl (%rax,%rdi,4), %edx cmpl 4(%rax,%rdi,4), %edxja .LBB0_8movq %rsi, %rdi.LBB0_8:movq %rdi, %rsi movl (%rax,%rdi,4), %edi cmpl %edi, %r8djae .LBB0_9 movl %edi, (%rax,%rcx,4) leaq (%rsi,%rsi), %rdi addq$1, %rdimovq %rsi, %rcx cmpq %r9, %rdijb .LBB0_5jmp .LBB0_11.LBB0_9:movq %rcx, %rsi.LBB0_11: movl %r8d, (%rax,%rsi,4).LBB0_12: popq %rax .cfi_def_cfa_offset 8 retq.LBB0_13: .cfi_def_cfa_offset 16 leaq .L__unnamed_1(%rip), %rdi xorl %esi, %esi xorl %edx, %edx callq *_ZN4core9panicking18panic_bounds_check17h59684c930baf7d8bE@GOTPCREL(%rip)ud2.Lfunc_end0: .size _ZN4core3ptr18real_drop_in_place17hb6242b27b5771784E, .Lfunc_end0-_ZN4core3ptr18real_drop_in_place17hb6242b27b5771784E .cfi_endproc .section .text.is_opt,"ax",@progbits .globl is_opt .p2align 4,0x90 .type is_opt,@functionis_opt:.Lfunc_begin0: .cfi_startproc .cfi_personality 155, DW.ref.rust_eh_personality .cfi_lsda 27, .Lexception0 subq$24, %rsp .cfi_def_cfa_offset 32 cmpq$0,16(%rdi)je .LBB1_18movq %rdi,8(%rsp) movb$1,16(%rsp) cmpq$0,16(%rdi)je .LBB1_2movq (%rdi), %rax movl$1, (%rax)movq16(%rdi), %r9 testq %r9, %r9je .LBB1_6movq (%rdi), %rax movl (%rax), %r8d cmpq$1, %r9jne .LBB1_9 xorl %esi, %esijmp .LBB1_16.LBB1_18: xorl %ecx, %ecx movl %ecx, %eax addq$24, %rsp .cfi_def_cfa_offset 8 retq.LBB1_9: .cfi_def_cfa_offset 32 movl$1, %edi xorl %ecx, %ecx .p2align 4,0x90.LBB1_10: leaq 1(%rdi), %rsi cmpq %r9, %rsijae .LBB1_13 movl (%rax,%rdi,4), %edx cmpl 4(%rax,%rdi,4), %edxja .LBB1_13movq %rsi, %rdi.LBB1_13:movq %rdi, %rsi movl (%rax,%rdi,4), %edi cmpl %edi, %r8djae .LBB1_14 movl %edi, (%rax,%rcx,4) leaq (%rsi,%rsi), %rdi addq$1, %rdimovq %rsi, %rcx cmpq %r9, %rdijb .LBB1_10jmp .LBB1_16.LBB1_14:movq %rcx, %rsi.LBB1_16: movl %r8d, (%rax,%rsi,4) movb$1, %cl movl %ecx, %eax addq$24, %rsp .cfi_def_cfa_offset 8 retq.LBB1_2: .cfi_def_cfa_offset 32.Ltmp3: leaq .L__unnamed_2(%rip), %rdi xorl %esi, %esi xorl %edx, %edx callq *_ZN4core9panicking18panic_bounds_check17h59684c930baf7d8bE@GOTPCREL(%rip).Ltmp4:jmp .LBB1_3.LBB1_6:.Ltmp0: leaq .L__unnamed_1(%rip), %rdi xorl %esi, %esi xorl %edx, %edx callq *_ZN4core9panicking18panic_bounds_check17h59684c930baf7d8bE@GOTPCREL(%rip).Ltmp1:.LBB1_3:ud2.LBB1_4:.Ltmp2:ud2ud2.LBB1_19:.Ltmp5: leaq 8(%rsp), %rdi callq _ZN4core3ptr18real_drop_in_place17hb6242b27b5771784Eud2ud2.Lfunc_end1: .size is_opt, .Lfunc_end1-is_opt .cfi_endproc .section .gcc_except_table,"a",@progbits .p2align 2GCC_except_table1:.Lexception0: .byte255 .byte255 .byte1 .uleb128 .Lcst_end0-.Lcst_begin0.Lcst_begin0: .uleb128 .Ltmp3-.Lfunc_begin0 .uleb128 .Ltmp4-.Ltmp3 .uleb128 .Ltmp5-.Lfunc_begin0 .byte0 .uleb128 .Ltmp0-.Lfunc_begin0 .uleb128 .Ltmp1-.Ltmp0 .uleb128 .Ltmp2-.Lfunc_begin0 .byte0 .uleb128 .Ltmp1-.Lfunc_begin0 .uleb128 .Lfunc_end1-.Ltmp1 .byte0 .byte0.Lcst_end0: .p2align 2 .type str.0,@object .section .rodata.str.0,"a",@progbits .p2align 4str.0: .ascii "/rustc/8a57831a4b7dfa960110599748f3b7382ae28237/src/libcore/slice/mod.rs" .size str.0,72 .type .L__unnamed_2,@object .section .data.rel.ro..L__unnamed_2,"aw",@progbits .p2align 3.L__unnamed_2: .quad str.0 .quad 72 .long 2541 .long 14 .size .L__unnamed_2,24 .type str.1,@object .section .rodata.str.1,"a",@progbits .p2align 4str.1: .ascii "/rustc/8a57831a4b7dfa960110599748f3b7382ae28237/src/liballoc/collections/binary_heap.rs" .size str.1,87 .type .L__unnamed_1,@object .section .data.rel.ro..L__unnamed_1,"aw",@progbits .p2align 3.L__unnamed_1: .quad str.1 .quad 87 .long 868 .long 30 .size .L__unnamed_1,24 .hidden DW.ref.rust_eh_personality .weak DW.ref.rust_eh_personality .section .data.DW.ref.rust_eh_personality,"aGw",@progbits,DW.ref.rust_eh_personality,comdat .p2align 3 .type DW.ref.rust_eh_personality,@object .size DW.ref.rust_eh_personality,8DW.ref.rust_eh_personality: .quad rust_eh_personality .section".note.GNU-stack","",@progbitsafter Details .text .file "peekmut.71651wce-cgu.0" .section .text.is_opt,"ax",@progbits .globl is_opt .p2align 4,0x90 .type is_opt,@functionis_opt: .cfi_startproc cmpq$0,16(%rdi)je .LBB0_1movq (%rdi), %rax movl$1, (%rax)movq16(%rdi), %r9 movb$1, %al cmpq$2, %r9jb .LBB0_11movq (%rdi), %r10 movl (%r10), %r8d movl$1, %esi xorl %edx, %edx .p2align 4,0x90.LBB0_4: leaq 1(%rsi), %rdi cmpq %r9, %rdijae .LBB0_7 movl (%r10,%rsi,4), %ecx cmpl 4(%r10,%rsi,4), %ecxja .LBB0_7movq %rdi, %rsi.LBB0_7:movq %rsi, %rdi movl (%r10,%rsi,4), %esi cmpl %esi, %r8djae .LBB0_8 movl %esi, (%r10,%rdx,4) leaq (%rdi,%rdi), %rsi addq$1, %rsimovq %rdi, %rdx cmpq %r9, %rsijb .LBB0_4jmp .LBB0_10.LBB0_1: xorl %eax, %eax retq.LBB0_8:movq %rdx, %rdi.LBB0_10: movl %r8d, (%r10,%rdi,4).LBB0_11: retq.Lfunc_end0: .size is_opt, .Lfunc_end0-is_opt .cfi_endproc .section".note.GNU-stack","",@progbits |
sfackler
commented
Feb 4, 2019
@bors r+ Thanks! |
bors
commented
Feb 4, 2019
📌 Commit ea72066 has been approved by |
Mark-Simulacrum
commented
Feb 6, 2019
@bors rollup |
…s, r=sfackler
Avoid some bounds checks in binary_heap::{PeekMut,Hole}
Fixesrust-lang#58121.Rollup of 23 pull requests Successful merges: - #58118 (Transition libtest to 2018 edition) - #58119 (libproc_macro => 2018) - #58123 (Avoid some bounds checks in binary_heap::{PeekMut,Hole}) - #58124 (libsyntax_pos => 2018) - #58133 (libsyntax_ext => 2018) - #58136 (Improve error message and docs for non-UTF-8 bytes in stdio on Windows) - #58156 (update submodule: rust-installer from 27dec6c to ccdc47b) - #58192 (Do not ICE in codegen when using a extern_type static) - #58193 (Move librustc to 2018) - #58210 (Make an assert debug-only in `find_constraint_paths_between_regions`.) - #58217 (librustc_tsan => 2018) - #58218 (librustc_msan => 2018) - #58219 (librustc_asan => 2018) - #58220 (libprofiler_builtins => 2018) - #58223 (librustc_lsan => 2018) - #58225 (librustc_fs_util => 2018) - #58228 (librustc_plugin => 2018) - #58236 (librustc_resolve => 2018) - #58237 (Fix broken grammar in iter::from_fn() docs) - #58239 (librustc_apfloat => 2018) - #58240 (librustc_errors => 2018) - #58241 (librustc_llvm => 2018) - #58242 (Document the one TyKind that isn't documented) Failed merges: - #58185 (Remove images' url to make it work even without internet connection) r? @ghost
Fixes#58121.