Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,29 @@ static MachineBasicBlock *LowerMemcpy(MachineInstr &MI, DebugLoc DL,
MachineOperand Src = MI.getOperand(3);
MachineOperand Len = MI.getOperand(4);

// If the length is a constant, we don't actually need the check.
if (MachineInstr *Def = MRI.getVRegDef(Len.getReg())) {
if (Def->getOpcode() == WebAssembly::CONST_I32 ||
Def->getOpcode() == WebAssembly::CONST_I64) {
if (Def->getOperand(1).getImm() == 0) {
// A zero-length memcpy is a no-op.
MI.eraseFromParent();
return BB;
}
// A non-zero-length memcpy doesn't need a zero check.
unsigned MemoryCopy =
Int64 ? WebAssembly::MEMORY_COPY_A64 : WebAssembly::MEMORY_COPY_A32;
BuildMI(*BB, MI, DL, TII.get(MemoryCopy))
.add(DstMem)
.add(SrcMem)
.add(Dst)
.add(Src)
.add(Len);
MI.eraseFromParent();
return BB;
}
}

// We're going to add an extra use to `Len` to test if it's zero; that
// use shouldn't be a kill, even if the original use is.
MachineOperand NoKillLen = Len;
Expand Down Expand Up @@ -669,6 +692,28 @@ static MachineBasicBlock *LowerMemset(MachineInstr &MI, DebugLoc DL,
MachineOperand Val = MI.getOperand(2);
MachineOperand Len = MI.getOperand(3);

// If the length is a constant, we don't actually need the check.
if (MachineInstr *Def = MRI.getVRegDef(Len.getReg())) {
if (Def->getOpcode() == WebAssembly::CONST_I32 ||
Def->getOpcode() == WebAssembly::CONST_I64) {
if (Def->getOperand(1).getImm() == 0) {
// A zero-length memset is a no-op.
MI.eraseFromParent();
return BB;
}
// A non-zero-length memset doesn't need a zero check.
unsigned MemoryFill =
Int64 ? WebAssembly::MEMORY_FILL_A64 : WebAssembly::MEMORY_FILL_A32;
BuildMI(*BB, MI, DL, TII.get(MemoryFill))
.add(Mem)
.add(Dst)
.add(Val)
.add(Len);
MI.eraseFromParent();
return BB;
}
}

// We're going to add an extra use to `Len` to test if it's zero; that
// use shouldn't be a kill, even if the original use is.
MachineOperand NoKillLen = Len;
Expand Down
97 changes: 43 additions & 54 deletions llvm/test/CodeGen/WebAssembly/bulk-memory.ll
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,31 @@ define void @memset_i32(ptr %dest, i8 %val, i32 %len) {
ret void
}

; CHECK-LABEL: memcpy_0:
; CHECK-NEXT: .functype memcpy_0 (i32, i32) -> ()
; CHECK-NEXT: return
define void @memcpy_0(ptr %dest, ptr %src) {
call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 0, i1 0)
ret void
}

; CHECK-LABEL: memmove_0:
; CHECK-NEXT: .functype memmove_0 (i32, i32) -> ()
; CHECK-NEXT: return
define void @memmove_0(ptr %dest, ptr %src) {
call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 0, i1 0)
ret void
}

; CHECK-LABEL: memset_0:
; NO-BULK-MEM-NOT: memory.fill
; BULK-MEM-NEXT: .functype memset_0 (i32, i32) -> ()
; BULK-MEM-NEXT: return
define void @memset_0(ptr %dest, i8 %val) {
call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 0, i1 0)
ret void
}

; CHECK-LABEL: memcpy_1:
; CHECK-NEXT: .functype memcpy_1 (i32, i32) -> ()
; CHECK-NEXT: i32.load8_u $push[[L0:[0-9]+]]=, 0($1)
Expand Down Expand Up @@ -137,14 +162,8 @@ define void @memset_1(ptr %dest, i8 %val) {
; CHECK-LABEL: memcpy_1024:
; NO-BULK-MEM-NOT: memory.copy
; BULK-MEM-NEXT: .functype memcpy_1024 (i32, i32) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i32.eqz $push[[L1:[0-9]+]]=, $pop[[L0]]
; BULK-MEM-NEXT: br_if 0, $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L2:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L2]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: return
define void @memcpy_1024(ptr %dest, ptr %src) {
call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 1024, i1 0)
Expand All @@ -154,14 +173,8 @@ define void @memcpy_1024(ptr %dest, ptr %src) {
; CHECK-LABEL: memmove_1024:
; NO-BULK-MEM-NOT: memory.copy
; BULK-MEM-NEXT: .functype memmove_1024 (i32, i32) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i32.eqz $push[[L1:[0-9]+]]=, $pop[[L0]]
; BULK-MEM-NEXT: br_if 0, $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L2:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L2]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: return
define void @memmove_1024(ptr %dest, ptr %src) {
call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 1024, i1 0)
Expand All @@ -171,14 +184,8 @@ define void @memmove_1024(ptr %dest, ptr %src) {
; CHECK-LABEL: memset_1024:
; NO-BULK-MEM-NOT: memory.fill
; BULK-MEM-NEXT: .functype memset_1024 (i32, i32) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i32.eqz $push[[L1:[0-9]+]]=, $pop[[L0]]
; BULK-MEM-NEXT: br_if 0, $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L2:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.fill 0, $0, $1, $pop[[L2]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: memory.fill 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: return
define void @memset_1024(ptr %dest, i8 %val) {
call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 1024, i1 0)
Expand All @@ -201,17 +208,11 @@ define void @memset_1024(ptr %dest, i8 %val) {
; BULK-MEM-NEXT: .functype memcpy_alloca_src (i32) -> ()
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
; BULK-MEM-NEXT: i32.sub $[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 100
; BULK-MEM-NEXT: i32.eqz $push[[L4:[0-9]+]]=, $pop[[L3]]
; BULK-MEM-NEXT: br_if 0, $pop[[L4]]
; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L6:[0-9]+]]=, $[[L2]], $pop[[L5]]
; BULK-MEM-NEXT: i32.const $push[[L7:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $pop[[L6]], $pop[[L7]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $pop[[L4]], $pop[[L5]]
; BULK-MEM-NEXT: return
define void @memcpy_alloca_src(ptr %dst) {
%a = alloca [100 x i8]
Expand All @@ -224,17 +225,11 @@ define void @memcpy_alloca_src(ptr %dst) {
; BULK-MEM-NEXT: .functype memcpy_alloca_dst (i32) -> ()
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
; BULK-MEM-NEXT: i32.sub $[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 100
; BULK-MEM-NEXT: i32.eqz $push[[L4:[0-9]+]]=, $pop[[L3]]
; BULK-MEM-NEXT: br_if 0, $pop[[L4]]
; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L6:[0-9]+]]=, $[[L2]], $pop[[L5]]
; BULK-MEM-NEXT: i32.const $push[[L7:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $pop[[L6]], $0, $pop[[L7]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L4:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L5:[0-9]+]]=, $pop[[L2]], $pop[[L4]]
; BULK-MEM-NEXT: i32.const $push[[L6:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $pop[[L5]], $0, $pop[[L6]]
Comment on lines +229 to +232
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No L3?

; BULK-MEM-NEXT: return
define void @memcpy_alloca_dst(ptr %src) {
%a = alloca [100 x i8]
Expand All @@ -247,17 +242,11 @@ define void @memcpy_alloca_dst(ptr %src) {
; BULK-MEM-NEXT: .functype memset_alloca (i32) -> ()
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
; BULK-MEM-NEXT: i32.sub $1=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i32.const $push[[L2:[0-9]+]]=, 100
; BULK-MEM-NEXT: i32.eqz $push[[L3:[0-9]+]]=, $pop[[L2]]
; BULK-MEM-NEXT: br_if 0, $pop[[L3]]
; BULK-MEM-NEXT: i32.const $push[[L4:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L5:[0-9]+]]=, $1, $pop[[L4]]
; BULK-MEM-NEXT: i32.const $push[[L6:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.fill 0, $pop[[L5]], $0, $pop[[L6]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 12
; BULK-MEM-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.fill 0, $pop[[L4]], $0, $pop[[L5]]
; BULK-MEM-NEXT: return
define void @memset_alloca(i8 %val) {
%a = alloca [100 x i8]
Expand Down
91 changes: 40 additions & 51 deletions llvm/test/CodeGen/WebAssembly/bulk-memory64.ll
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ define void @memset_i32(ptr %dest, i8 %val, i64 %len) {
ret void
}

; CHECK-LABEL: memcpy_0:
; CHECK-NEXT: .functype memcpy_0 (i64, i64) -> ()
; CHECK-NEXT: return
define void @memcpy_0(ptr %dest, ptr %src) {
call void @llvm.memcpy.p0.p0.i64(ptr %dest, ptr %src, i64 0, i1 0)
ret void
}

; CHECK-LABEL: memmove_0:
; CHECK-NEXT: .functype memmove_0 (i64, i64) -> ()
; CHECK-NEXT: return
define void @memmove_0(ptr %dest, ptr %src) {
call void @llvm.memmove.p0.p0.i64(ptr %dest, ptr %src, i64 0, i1 0)
ret void
}

; CHECK-LABEL: memset_0:
; NO-BULK-MEM-NOT: memory.fill
; BULK-MEM-NEXT: .functype memset_0 (i64, i32) -> ()
; BULK-MEM-NEXT: return
define void @memset_0(ptr %dest, i8 %val) {
call void @llvm.memset.p0.i64(ptr %dest, i8 %val, i64 0, i1 0)
ret void
}

; CHECK-LABEL: memcpy_1:
; CHECK-NEXT: .functype memcpy_1 (i64, i64) -> ()
; CHECK-NEXT: i32.load8_u $push[[L0:[0-9]+]]=, 0($1)
Expand Down Expand Up @@ -143,14 +168,8 @@ define void @memset_1(ptr %dest, i8 %val) {
; CHECK-LABEL: memcpy_1024:
; NO-BULK-MEM-NOT: memory.copy
; BULK-MEM-NEXT: .functype memcpy_1024 (i64, i64) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L1:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i64.eqz $push0=, $pop[[L1]]
; BULK-MEM-NEXT: br_if 0, $pop0
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: return
define void @memcpy_1024(ptr %dest, ptr %src) {
call void @llvm.memcpy.p0.p0.i64(ptr %dest, ptr %src, i64 1024, i1 0)
Expand All @@ -160,14 +179,8 @@ define void @memcpy_1024(ptr %dest, ptr %src) {
; CHECK-LABEL: memmove_1024:
; NO-BULK-MEM-NOT: memory.copy
; BULK-MEM-NEXT: .functype memmove_1024 (i64, i64) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L1:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i64.eqz $push0=, $pop[[L1]]
; BULK-MEM-NEXT: br_if 0, $pop0
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: return
define void @memmove_1024(ptr %dest, ptr %src) {
call void @llvm.memmove.p0.p0.i64(ptr %dest, ptr %src, i64 1024, i1 0)
Expand All @@ -177,14 +190,8 @@ define void @memmove_1024(ptr %dest, ptr %src) {
; CHECK-LABEL: memset_1024:
; NO-BULK-MEM-NOT: memory.fill
; BULK-MEM-NEXT: .functype memset_1024 (i64, i32) -> ()
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L1:[0-9]+]]=, 1024
; BULK-MEM-NEXT: i64.eqz $push0=, $pop[[L1]]
; BULK-MEM-NEXT: br_if 0, $pop0
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 1024
; BULK-MEM-NEXT: memory.fill 0, $0, $1, $pop[[L0]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: return
define void @memset_1024(ptr %dest, i8 %val) {
call void @llvm.memset.p0.i64(ptr %dest, i8 %val, i64 1024, i1 0)
Expand All @@ -207,17 +214,11 @@ define void @memset_1024(ptr %dest, i8 %val) {
; BULK-MEM-NEXT: .functype memcpy_alloca_src (i64) -> ()
; BULK-MEM-NEXT: global.get $push[[L1:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 112
; BULK-MEM-NEXT: i64.sub $[[L2:[0-9]+]]=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L3:[0-9]+]]=, 100
; BULK-MEM-NEXT: i64.eqz $push[[L4:[0-9]+]]=, $pop[[L3]]
; BULK-MEM-NEXT: br_if 0, $pop[[L4]]
; BULK-MEM-NEXT: i64.const $push[[L5:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L6:[0-9]+]]=, $[[L2]], $pop[[L5]]
; BULK-MEM-NEXT: i64.const $push[[L7:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $pop[[L6]], $pop[[L7]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i64.sub $push[[L2:[0-9]+]]=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: i64.const $push[[L3:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
; BULK-MEM-NEXT: i64.const $push[[L5:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $pop[[L4]], $pop[[L5]]
; BULK-MEM-NEXT: return
define void @memcpy_alloca_src(ptr %dst) {
%a = alloca [100 x i8]
Expand All @@ -230,17 +231,11 @@ define void @memcpy_alloca_src(ptr %dst) {
; BULK-MEM-NEXT: .functype memcpy_alloca_dst (i64) -> ()
; BULK-MEM-NEXT: global.get $push[[L1:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 112
; BULK-MEM-NEXT: i64.sub $[[L2:[0-9]+]]=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L3:[0-9]+]]=, 100
; BULK-MEM-NEXT: i64.eqz $push[[L4:[0-9]+]]=, $pop[[L3]]
; BULK-MEM-NEXT: br_if 0, $pop[[L4]]
; BULK-MEM-NEXT: i64.const $push[[L5:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L6:[0-9]+]]=, $[[L2]], $pop[[L5]]
; BULK-MEM-NEXT: i64.const $push[[L7:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $pop[[L6]], $0, $pop[[L7]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i64.sub $push[[L2:[0-9]+]]=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: i64.const $push[[L3:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
; BULK-MEM-NEXT: i64.const $push[[L5:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.copy 0, 0, $pop[[L4]], $0, $pop[[L5]]
; BULK-MEM-NEXT: return
define void @memcpy_alloca_dst(ptr %src) {
%a = alloca [100 x i8]
Expand All @@ -253,17 +248,11 @@ define void @memcpy_alloca_dst(ptr %src) {
; BULK-MEM-NEXT: .functype memset_alloca (i32) -> ()
; BULK-MEM-NEXT: global.get $push[[L1:[0-9]+]]=, __stack_pointer
; BULK-MEM-NEXT: i64.const $push[[L0:[0-9]+]]=, 112
; BULK-MEM-NEXT: i64.sub $1=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: block
; BULK-MEM-NEXT: i64.const $push[[L2:[0-9]+]]=, 100
; BULK-MEM-NEXT: i64.eqz $push[[L3:[0-9]+]]=, $pop[[L2]]
; BULK-MEM-NEXT: br_if 0, $pop[[L3]]
; BULK-MEM-NEXT: i64.const $push[[L4:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L5:[0-9]+]]=, $1, $pop[[L4]]
; BULK-MEM-NEXT: i64.const $push[[L6:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.fill 0, $pop[[L5]], $0, $pop[[L6]]
; BULK-MEM-NEXT: .LBB{{.*}}:
; BULK-MEM-NEXT: end_block
; BULK-MEM-NEXT: i64.sub $push[[L2:[0-9]+]]=, $pop[[L1]], $pop[[L0]]
; BULK-MEM-NEXT: i64.const $push[[L3:[0-9]+]]=, 12
; BULK-MEM-NEXT: i64.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
; BULK-MEM-NEXT: i64.const $push[[L5:[0-9]+]]=, 100
; BULK-MEM-NEXT: memory.fill 0, $pop[[L4]], $0, $pop[[L5]]
; BULK-MEM-NEXT: return
define void @memset_alloca(i8 %val) {
%a = alloca [100 x i8]
Expand Down