rust icon indicating copy to clipboard operation
rust copied to clipboard

Add pointer masking convenience functions

Open WaffleLapkin opened this issue 2 years ago • 14 comments

This PR adds the following public API:

impl<T: ?Sized> *const T {
    fn mask(self, mask: usize) -> *const T;
}

impl<T: ?Sized> *mut T {
    fn mask(self, mask: usize) -> *const T;
}

// mod intrinsics
fn mask<T>(ptr: *const T, mask: usize) -> *const T

This is equivalent to ptr.map_addr(|a| a & mask) but also uses a cool llvm intrinsic.

Proposed in https://github.com/rust-lang/rust/pull/95643#issuecomment-1121562352

cc @Gankra @scottmcm @RalfJung

r? rust-lang/libs-api

WaffleLapkin avatar May 11 '22 14:05 WaffleLapkin

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

rust-highfive avatar May 11 '22 14:05 rust-highfive

@rustbot label +T-libs-api -T-libs

WaffleLapkin avatar May 11 '22 14:05 WaffleLapkin

Makes sense! Should this be added to the strict provenance feature gate?

Also, if/when this lands it'd be great if you could also implement the new intrinsic for Miri. :)

RalfJung avatar May 11 '22 14:05 RalfJung

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking cranelift-frontend v0.83.0
    Checking cranelift-native v0.83.0
    Checking cranelift-object v0.83.0
    Checking rustc_codegen_cranelift v0.1.0 (/checkout/compiler/rustc_codegen_cranelift)
error: no rules expected the token `transmute`
    |
29  | macro_rules! intrinsic_match {
    | ---------------------------- when calling this macro
...
...
539 |         transmute, (c from) {
    |         ^^^^^^^^^ no rules expected this token in macro call
error: unused import: `rustc_middle::ty::print::with_no_trimmed_paths`
  --> src/intrinsics/mod.rs:58:5
   |
58 | use rustc_middle::ty::print::with_no_trimmed_paths;
58 | use rustc_middle::ty::print::with_no_trimmed_paths;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D unused-imports` implied by `-D warnings`
error: unused import: `kw`
  --> src/intrinsics/mod.rs:60:26
   |
   |
60 | use rustc_span::symbol::{kw, sym, Symbol};


error: unused import: `cranelift_codegen::ir::AtomicRmwOp`
   |
   |
63 | use cranelift_codegen::ir::AtomicRmwOp;

error: could not compile `rustc_codegen_cranelift` due to 4 previous errors
Build completed unsuccessfully in 0:03:08

rust-log-analyzer avatar May 11 '22 14:05 rust-log-analyzer

Should this be added to the strict provenance feature gate?

I don't really have an opinion on this. While this is mostly useful to mask pointers without touching provenance it may also be used as a shorter version of ptr as uszie & mask (vs ptr.mask(mask)).

Also, if/when this lands it'd be great if you could also implement the new intrinsic for Miri. :)

Sure, I'll take a look into that!

WaffleLapkin avatar May 11 '22 14:05 WaffleLapkin

:umbrella: The latest upstream changes (presumably #95643) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar May 19 '22 02:05 bors

this is still waiting on review

JohnCSimon avatar Jun 20 '22 04:06 JohnCSimon

:umbrella: The latest upstream changes (presumably #99802) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Jul 27 '22 15:07 bors

I think this is now waiting for a feedback from T-libs-api cc @joshtriplett (who was autoassigned)

apiraino avatar Jul 28 '22 14:07 apiraino

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

rustbot avatar Aug 05 '22 14:08 rustbot

I've rebased to fix the merge conflicts. Still waiting on review.

WaffleLapkin avatar Aug 05 '22 14:08 WaffleLapkin

Still waiting on review.

@joshtriplett seems to be pretty busy recently and not get around to much reviewing or just have too many PRs assigned, we might want to re-roll the reviewer dice. r? libs

RalfJung avatar Aug 05 '22 15:08 RalfJung

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_codegen_cranelift v0.1.0 (/checkout/compiler/rustc_codegen_cranelift)
error[E0308]: arguments to this function are incorrect
    --> src/intrinsics/mod.rs:545:26
     |
545  |             fx.bcx.ins().band(ptr, mask);
     |                          ^^^^ ---  ---- expected struct `cranelift_codegen::ir::Value`, found struct `value_and_place::CValue`
     |                               |
     |                               expected struct `cranelift_codegen::ir::Value`, found struct `value_and_place::CValue`
note: associated function defined here
    --> /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/cranelift-codegen-98ed3bec4c044c17/out/inst_builder.rs:2496:8
     |
     |
2496 |     fn band(self, x: ir::Value, y: ir::Value) -> Value {

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rustc_codegen_cranelift` due to previous error
Build completed unsuccessfully in 0:03:28

rust-log-analyzer avatar Aug 05 '22 16:08 rust-log-analyzer

I think I can take the review here. The APIs are unstable, so don't strictly need libs-api. r? @scottmcm

Because this adds an intrinsic, can you also add a codegen test? See https://github.com/rust-lang/rust/tree/master/src/test/codegen/intrinsics (and, if you're new to them, https://llvm.org/docs/CommandGuide/FileCheck.html might be helpful too). That way we can see it emitting the expected and correct LLVM.

(Looks like there are some PR build failures too, right now.)

@rustbot author

scottmcm avatar Aug 05 '22 18:08 scottmcm

build fixed, codegen test added.

@rustbot ready

WaffleLapkin avatar Aug 08 '22 17:08 WaffleLapkin

Thanks! I think this is good to go now. If there's other tweaks that come up they can be future PRs.

@bors r+ rollup=iffy (codegen stuff probably shouldn't be in big rollups, just in case)

scottmcm avatar Aug 09 '22 19:08 scottmcm

:pushpin: Commit ccc558a9751074e6a075266192cb2e8393ba16a7 has been approved by scottmcm

It is now in the queue for this repository.

bors avatar Aug 09 '22 19:08 bors

:hourglass: Testing commit ccc558a9751074e6a075266192cb2e8393ba16a7 with merge 5ceecfe2383829a0615b7756797a2b219bc1f310...

bors avatar Aug 15 '22 17:08 bors

:broken_heart: Test failed - checks-actions

bors avatar Aug 15 '22 18:08 bors

The job x86_64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
warning:   399 |   (void)COMPILER_RT_FTRUNCATE(ProfileFile,
warning:       |         ^~~~~~~~~~~~~~~~~~~~~
   Compiling rustc-std-workspace-core v1.99.0 (/checkout/library/rustc-std-workspace-core)
[RUSTC-TIMING] rustc_std_workspace_core test:false 0.030
rustc: /checkout/src/llvm-project/llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
[RUSTC-TIMING] core test:false 22.258
rustc exited with signal: 6 (SIGABRT) (core dumped)

Caused by:
Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C debuginfo=0 -C debug-assertions=on -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=fa992565d2130c71 -C extra-filename=-fa992565d2130c71 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(freebsd12)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_os,"watchos")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","nvptx64","le32","xtensa")' '--check-cfg=values(dont_compile_me)' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=off -Cprefer-dynamic -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 254)
warning: build failed, waiting for other jobs to finish...
rustc: /checkout/src/llvm-project/llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
rustc: /checkout/src/llvm-project/llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
[RUSTC-TIMING] compiler_builtins test:false 0.956
rustc exited with signal: 6 (SIGABRT) (core dumped)

Caused by:
Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name compiler_builtins /cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.79/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=10000 -C debuginfo=0 --cfg 'feature="c"' --cfg 'feature="cc"' --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=e15157c448d27e55 -C extra-filename=-e15157c448d27e55 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_std_workspace_core-a842d6fd47d5c6b1.rmeta --cap-lints allow -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(freebsd12)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_os,"watchos")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","nvptx64","le32","xtensa")' '--check-cfg=values(dont_compile_me)' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=off -Cprefer-dynamic -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-99e323f7ecb02094/out -l static=compiler-rt --cfg 'feature="unstable"' --cfg 'feature="mem-unaligned"' --cfg '__absvdi2="optimized-c"' --cfg '__absvsi2="optimized-c"' --cfg '__absvti2="optimized-c"' --cfg '__addvdi3="optimized-c"' --cfg '__addvsi3="optimized-c"' --cfg '__addvti3="optimized-c"' --cfg '__clzdi2="optimized-c"' --cfg '__clzsi2="optimized-c"' --cfg '__clzti2="optimized-c"' --cfg '__cmpdi2="optimized-c"' --cfg '__cmpti2="optimized-c"' --cfg '__ctzdi2="optimized-c"' --cfg '__ctzsi2="optimized-c"' --cfg '__ctzti2="optimized-c"' --cfg '__divdc3="optimized-c"' --cfg '__divsc3="optimized-c"' --cfg '__divxc3="optimized-c"' --cfg '__extendhfsf2="optimized-c"' --cfg '__ffsti2="optimized-c"' --cfg '__floatdixf="optimized-c"' --cfg '__floatundixf="optimized-c"' --cfg '__int_util="optimized-c"' --cfg '__muldc3="optimized-c"' --cfg '__mulsc3="optimized-c"' --cfg '__mulvdi3="optimized-c"' --cfg '__mulvsi3="optimized-c"' --cfg '__mulvti3="optimized-c"' --cfg '__mulxc3="optimized-c"' --cfg '__negdf2="optimized-c"' --cfg '__negdi2="optimized-c"' --cfg '__negsf2="optimized-c"' --cfg '__negti2="optimized-c"' --cfg '__negvdi2="optimized-c"' --cfg '__negvsi2="optimized-c"' --cfg '__negvti2="optimized-c"' --cfg '__paritydi2="optimized-c"' --cfg '__paritysi2="optimized-c"' --cfg '__parityti2="optimized-c"' --cfg '__popcountdi2="optimized-c"' --cfg '__popcountsi2="optimized-c"' --cfg '__popcountti2="optimized-c"' --cfg '__powixf2="optimized-c"' --cfg '__subvdi3="optimized-c"' --cfg '__subvsi3="optimized-c"' --cfg '__subvti3="optimized-c"' --cfg '__truncdfhf2="optimized-c"' --cfg '__truncsfhf2="optimized-c"' --cfg '__ucmpdi2="optimized-c"' --cfg '__ucmpti2="optimized-c"'` (exit status: 254)
[RUSTC-TIMING] libc test:false 0.992
rustc exited with signal: 6 (SIGABRT) (core dumped)
error: could not compile `libc`
Caused by:
Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name libc /cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.129/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C debuginfo=0 -C debug-assertions=on --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=7d463faa7f12f003 -C extra-filename=-7d463faa7f12f003 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern rustc_std_workspace_core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_std_workspace_core-a842d6fd47d5c6b1.rmeta --cap-lints allow -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(freebsd12)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_os,"watchos")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","nvptx64","le32","xtensa")' '--check-cfg=values(dont_compile_me)' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=off -Cprefer-dynamic -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo --cfg freebsd11 --cfg libc_priv_mod_use --cfg libc_union --cfg libc_const_size_of --cfg libc_align --cfg libc_int128 --cfg libc_core_cvoid --cfg libc_packedN --cfg libc_cfg_target_vendor --cfg libc_non_exhaustive --cfg libc_ptr_addr_of --cfg libc_underscore_const_names --cfg libc_thread_local --cfg libc_const_extern_fn` (exit status: 254)

rust-log-analyzer avatar Aug 15 '22 18:08 rust-log-analyzer

Since this PR does do llvm-stuff with pointer types, this failure looks like it might be legit (https://github.com/rust-lang-ci/rust/runs/7843167630?check_suite_focus=true#step:25:7649), so please take another look here, @WaffleLapkin.

@bors r- @rustbot author

scottmcm avatar Aug 15 '22 18:08 scottmcm

So the errors seems to be happening here while building std:

PointerType *PointerType::get(Type *EltTy, unsigned AddressSpace) {
  assert(EltTy && "Can't get a pointer to <null> type!");
  assert(isValidElementType(EltTy) && "Invalid type for pointer element!"); // <--

  // ...
}

bool PointerType::isValidElementType(Type *ElemTy) {
  return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
         !ElemTy->isMetadataTy() && !ElemTy->isTokenTy() &&
         !ElemTy->isX86_AMXTy();
}

I'm not yet sure, but since we call @llvm.ptrmask.p0isVoid.[[WORD]] this is likely a genuine error with ptr_mask llvm implementation

WaffleLapkin avatar Aug 18 '22 16:08 WaffleLapkin

I can't find where it's documented, but apparently void in llvm is only valid as the return type of functions, and not as a pointer element type (at least this post from 2008 suggests so?...).

Changing the pointer type used by the intrinsic to point to i8 instead fixed the issue locally.

@rustbot ready

WaffleLapkin avatar Aug 18 '22 18:08 WaffleLapkin

@bors r+ rollup=iffy

scottmcm avatar Aug 18 '22 19:08 scottmcm

:pushpin: Commit 5abe2dc34d09f8d1aa3ce1c94dc52754a3af0980 has been approved by scottmcm

It is now in the queue for this repository.

bors avatar Aug 18 '22 19:08 bors

@bors r- failed in a rollup https://github.com/rust-lang/rust/pull/100799#issuecomment-1221315652

matthiaskrgr avatar Aug 20 '22 13:08 matthiaskrgr

So, it seems like in the ~1000 commits since I've made this branch llvm was updated bringing opaque pointers with it 😄

cc @nikic, actually -- should it be @llvm.ptrmask.{{ptr|p0isVoid}}.[[WORD]]( to make sure not to fail in the opaque pointers future?

It seems it should have been {{p0|p0i8}} (at least with the new checkout I get p0 and before that I was getting p0i8)

WaffleLapkin avatar Aug 21 '22 02:08 WaffleLapkin

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 351 tests
ii.............i....i..ii.................iii........ii.i.......i.................ii.... 88/351
.............i............i..i.................i.F.iii........i..i......i.i........i..ii 176/351
Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
i.i.ii.i......i.......iii.......i...i.....................iiiiiiii.i...................
failures:


---- [codegen] src/test/codegen/intrinsics/mask.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-13/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll" "/checkout/src/test/codegen/intrinsics/mask.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,NONMSVC"
stdout: none
--- stderr -------------------------------
/checkout/src/test/codegen/intrinsics/mask.rs:9:17: error: CHECK-SAME: expected string not found in input
 // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]](ptr %ptr, [[WORD]] %mask)
                ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: scanning from here
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: with "WORD" equal to "i64"
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: with "WORD" equal to "i64"
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:21: note: possible intended match here
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll
Check file: /checkout/src/test/codegen/intrinsics/mask.rs


-dump-input=help explains the following input dump.
Input was:
<<<<<<
          .
          .
          .
          .
          5:  
          6: ; Function Attrs: mustprogress nofree nosync nounwind nonlazybind readnone uwtable willreturn 
          7: define i16* @mask_ptr(i16* readnone %ptr, i64 %mask) unnamed_addr #0 { 
          8: start: 
          9:  %0 = bitcast i16* %ptr to i8* 
         10:  %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask) 
same:9'0                    X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
same:9'1                                                                    with "WORD" equal to "i64"
same:9'2                                                                    with "WORD" equal to "i64"
same:9'3                         ?                                          possible intended match
         11:  %2 = bitcast i8* %1 to i16* 
same:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         12:  ret i16* %2 
same:9'0     ~~~~~~~~~~~~~
         13: } 
same:9'0     ~~
         14:  
same:9'0     ~
         15: ; Function Attrs: mustprogress nofree nosync nounwind readnone speculatable willreturn 
same:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
>>>>>>
------------------------------------------

rust-log-analyzer avatar Aug 21 '22 02:08 rust-log-analyzer

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 351 tests
ii.............i....i..ii..................iii.......ii.i.......i.................ii.... 88/351
.............i............i..i.................i.F.iii........i..i......i.i........i..ii 176/351
Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
i.i.ii.i......i.......iii.......i...i.....................iiiiiiii.i...................
failures:


---- [codegen] src/test/codegen/intrinsics/mask.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-13/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll" "/checkout/src/test/codegen/intrinsics/mask.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,NONMSVC"
stdout: none
--- stderr -------------------------------
/checkout/src/test/codegen/intrinsics/mask.rs:9:17: error: CHECK-SAME: expected string not found in input
 // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} %ptr, [[WORD]] %mask)
                ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: scanning from here
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: with "WORD" equal to "i64"
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:16: note: with "WORD" equal to "i64"
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll:10:21: note: possible intended match here
 %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask)

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/intrinsics/mask/mask.ll
Check file: /checkout/src/test/codegen/intrinsics/mask.rs


-dump-input=help explains the following input dump.
Input was:
<<<<<<
          .
          .
          .
          .
          5:  
          6: ; Function Attrs: mustprogress nofree nosync nounwind nonlazybind readnone uwtable willreturn 
          7: define i16* @mask_ptr(i16* readnone %ptr, i64 %mask) unnamed_addr #0 { 
          8: start: 
          9:  %0 = bitcast i16* %ptr to i8* 
         10:  %1 = tail call i8* @llvm.ptrmask.p0i8.i64(i8* %0, i64 %mask) 
same:9'0                    X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
same:9'1                                                                    with "WORD" equal to "i64"
same:9'2                                                                    with "WORD" equal to "i64"
same:9'3                         ?                                          possible intended match
         11:  %2 = bitcast i8* %1 to i16* 
same:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         12:  ret i16* %2 
same:9'0     ~~~~~~~~~~~~~
         13: } 
same:9'0     ~~
         14:  
same:9'0     ~
         15: ; Function Attrs: mustprogress nofree nosync nounwind readnone speculatable willreturn 
same:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
>>>>>>
------------------------------------------

rust-log-analyzer avatar Aug 21 '22 03:08 rust-log-analyzer

@bors r+

scottmcm avatar Aug 21 '22 18:08 scottmcm

:pushpin: Commit ca753124088c0d57ca6728ee093363cbc1db5274 has been approved by scottmcm

It is now in the queue for this repository.

bors avatar Aug 21 '22 18:08 bors