Skip to content

Commit

Permalink
Use memset when repeating 128bit zero value
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Sep 9, 2022
1 parent 7279106 commit e4d3abf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let size = bx.const_usize(dest.layout.size.bytes());

// Use llvm.memset.p0i8.* to initialize all zero arrays
if bx.cx().const_to_opt_uint(v) == Some(0) {
if bx.cx().const_to_opt_u128(v, false) == Some(0) {
let fill = bx.cx().const_u8(0);
bx.memset(start, fill, size, dest.align, MemFlags::empty());
return bx;
Expand Down

0 comments on commit e4d3abf

Please sign in to comment.