Skip to content

Commit a7373b7

Browse files
committed
Rename to llvm.experimental.memset.pattern
1 parent 03e07d5 commit a7373b7

File tree

11 files changed

+50
-51
lines changed

11 files changed

+50
-51
lines changed

llvm/docs/LangRef.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15434,28 +15434,29 @@ The behavior of '``llvm.memset.inline.*``' is equivalent to the behavior of
1543415434
'``llvm.memset.*``', but the generated code is guaranteed not to call any
1543515435
external functions.
1543615436

15437-
.. _int_memset_pattern:
15437+
.. _int_experimental_memset_pattern:
1543815438

15439-
'``llvm.memset.pattern``' Intrinsic
15439+
'``llvm.experimental.memset.pattern``' Intrinsic
1544015440
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1544115441

1544215442
Syntax:
1544315443
"""""""
1544415444

15445-
This is an overloaded intrinsic. You can use ``llvm.memset.pattern`` on
15446-
any integer bit width that is an integral number of bytes and for different
15447-
address spaces. Not all targets support all bit widths however.
15445+
This is an overloaded intrinsic. You can use
15446+
``llvm.experimental.memset.pattern`` on any integer bit width that is an
15447+
integral number of bytes and for different address spaces. Not all targets
15448+
support all bit widths however.
1544815449

1544915450
::
1545015451

15451-
declare void @llvm.memset.pattern.p0.i128.i64(ptr <dest>, i128 <val>,
15452-
i64 <count>, i1 <isvolatile>)
15452+
declare void @llvm.experimental.memset.pattern.p0.i128.i64(ptr <dest>, i128 <val>,
15453+
i64 <count>, i1 <isvolatile>)
1545315454

1545415455
Overview:
1545515456
"""""""""
1545615457

15457-
The '``llvm.memset.pattern.*``' intrinsics fill a block of memory with
15458-
a particular value. This may be expanded to an inline loop, a sequence of
15458+
The '``llvm.experimental.memset.pattern.*``' intrinsics fill a block of memory
15459+
with a particular value. This may be expanded to an inline loop, a sequence of
1545915460
stores, or a libcall depending on what is available for the target and the
1546015461
expected performance and code size impact.
1546115462

@@ -15471,21 +15472,21 @@ The :ref:`align <attr_align>` parameter attribute can be provided
1547115472
for the first argument.
1547215473

1547315474
If the ``isvolatile`` parameter is ``true``, the
15474-
``llvm.memset.pattern`` call is a :ref:`volatile operation <volatile>`. The
15475-
detailed access behavior is not very cleanly specified and it is unwise to
15476-
depend on it.
15475+
``llvm.experimental.memset.pattern`` call is a :ref:`volatile operation
15476+
<volatile>`. The detailed access behavior is not very cleanly specified and it
15477+
is unwise to depend on it.
1547715478

1547815479
Semantics:
1547915480
""""""""""
1548015481

15481-
The '``llvm.memset.pattern*``' intrinsic fills memory starting at the
15482-
destination location with the given pattern ``<count>`` times. If the argument
15483-
is known to be aligned to some boundary, this can be specified as an attribute
15484-
on the argument. The pattern fills will respect the endianness of the target:
15485-
i.e. on little endian targets, the least significant byte of the pattern is
15486-
first in memory, while the most significant byte is first in memory for big
15487-
endian targets. The memory address is incremented by the allocation size of
15488-
the type.
15482+
The '``llvm.experimental.memset.pattern*``' intrinsic fills memory starting at
15483+
the destination location with the given pattern ``<count>`` times. If the
15484+
argument is known to be aligned to some boundary, this can be specified as an
15485+
attribute on the argument. The pattern fills will respect the endianness of
15486+
the target: i.e. on little endian targets, the least significant byte of the
15487+
pattern is first in memory, while the most significant byte is first in memory
15488+
for big endian targets. The memory address is incremented by the allocation
15489+
size of the type.
1548915490

1549015491
If ``<count>`` is 0, it is no-op modulo the behavior of attributes attached to
1549115492
the arguments.

llvm/include/llvm/IR/InstVisitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class InstVisitor {
296296
case Intrinsic::memset: DELEGATE(MemSetInst);
297297
case Intrinsic::memset_inline:
298298
DELEGATE(MemSetInlineInst);
299-
case Intrinsic::memset_pattern:
299+
case Intrinsic::experimental_memset_pattern:
300300
DELEGATE(MemSetPatternInst);
301301
case Intrinsic::vastart: DELEGATE(VAStartInst);
302302
case Intrinsic::vaend: DELEGATE(VAEndInst);

llvm/include/llvm/IR/IntrinsicInst.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
12221222
case Intrinsic::memmove:
12231223
case Intrinsic::memset:
12241224
case Intrinsic::memset_inline:
1225-
case Intrinsic::memset_pattern:
1225+
case Intrinsic::experimental_memset_pattern:
12261226
case Intrinsic::memcpy_inline:
12271227
return true;
12281228
default:
@@ -1235,15 +1235,15 @@ class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
12351235
};
12361236

12371237
/// This class wraps the llvm.memset, llvm.memset.inline, and
1238-
/// llvm.memset.pattern intrinsics.
1238+
/// llvm.experimental.memset.pattern intrinsics.
12391239
class MemSetInst : public MemSetBase<MemIntrinsic> {
12401240
public:
12411241
// Methods for support type inquiry through isa, cast, and dyn_cast:
12421242
static bool classof(const IntrinsicInst *I) {
12431243
switch (I->getIntrinsicID()) {
12441244
case Intrinsic::memset:
12451245
case Intrinsic::memset_inline:
1246-
case Intrinsic::memset_pattern:
1246+
case Intrinsic::experimental_memset_pattern:
12471247
return true;
12481248
default:
12491249
return false;
@@ -1266,12 +1266,12 @@ class MemSetInlineInst : public MemSetInst {
12661266
}
12671267
};
12681268

1269-
/// This class wraps the llvm.memset.pattern intrinsic.
1269+
/// This class wraps the llvm.experimental.memset.pattern intrinsic.
12701270
class MemSetPatternInst : public MemSetInst {
12711271
public:
12721272
// Methods for support type inquiry through isa, cast, and dyn_cast:
12731273
static bool classof(const IntrinsicInst *I) {
1274-
return I->getIntrinsicID() == Intrinsic::memset_pattern;
1274+
return I->getIntrinsicID() == Intrinsic::experimental_memset_pattern;
12751275
}
12761276
static bool classof(const Value *V) {
12771277
return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
@@ -1354,7 +1354,7 @@ class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
13541354
case Intrinsic::memmove:
13551355
case Intrinsic::memset:
13561356
case Intrinsic::memset_inline:
1357-
case Intrinsic::memset_pattern:
1357+
case Intrinsic::experimental_memset_pattern:
13581358
case Intrinsic::memcpy_element_unordered_atomic:
13591359
case Intrinsic::memmove_element_unordered_atomic:
13601360
case Intrinsic::memset_element_unordered_atomic:
@@ -1377,7 +1377,7 @@ class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
13771377
switch (I->getIntrinsicID()) {
13781378
case Intrinsic::memset:
13791379
case Intrinsic::memset_inline:
1380-
case Intrinsic::memset_pattern:
1380+
case Intrinsic::experimental_memset_pattern:
13811381
case Intrinsic::memset_element_unordered_atomic:
13821382
return true;
13831383
default:

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def int_memset_inline
10071007
ImmArg<ArgIndex<3>>]>;
10081008

10091009
// Memset variant that writes a given pattern.
1010-
def int_memset_pattern
1010+
def int_experimental_memset_pattern
10111011
: Intrinsic<[],
10121012
[llvm_anyptr_ty, // Destination.
10131013
llvm_anyint_ty, // Pattern value.

llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ bool PreISelIntrinsicLowering::expandMemIntrinsicUses(Function &F) const {
320320
Memset->eraseFromParent();
321321
break;
322322
}
323-
case Intrinsic::memset_pattern: {
323+
case Intrinsic::experimental_memset_pattern: {
324324
auto *Memset = cast<MemSetPatternInst>(Inst);
325325
expandMemSetAsLoop(Memset);
326326
Changed = true;
@@ -346,7 +346,7 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
346346
case Intrinsic::memmove:
347347
case Intrinsic::memset:
348348
case Intrinsic::memset_inline:
349-
case Intrinsic::memset_pattern:
349+
case Intrinsic::experimental_memset_pattern:
350350
Changed |= expandMemIntrinsicUses(F);
351351
break;
352352
case Intrinsic::load_relative:

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5520,7 +5520,7 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
55205520
case Intrinsic::memmove:
55215521
case Intrinsic::memset:
55225522
case Intrinsic::memset_inline:
5523-
case Intrinsic::memset_pattern: {
5523+
case Intrinsic::experimental_memset_pattern: {
55245524
break;
55255525
}
55265526
case Intrinsic::memcpy_element_unordered_atomic:

llvm/test/CodeGen/RISCV/memset-pattern.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define void @memset_1(ptr %a, i128 %value) nounwind {
4747
; RV64-BOTH-NEXT: bne a0, a3, .LBB0_1
4848
; RV64-BOTH-NEXT: # %bb.2: # %split
4949
; RV64-BOTH-NEXT: ret
50-
tail call void @llvm.memset.pattern(ptr align 8 %a, i128 %value, i64 1, i1 0)
50+
tail call void @llvm.experimental.memset.pattern(ptr align 8 %a, i128 %value, i64 1, i1 0)
5151
ret void
5252
}
5353

@@ -197,7 +197,7 @@ define void @memset_1_noalign(ptr %a, i128 %value) nounwind {
197197
; RV64-FAST-NEXT: bne a0, a3, .LBB1_1
198198
; RV64-FAST-NEXT: # %bb.2: # %split
199199
; RV64-FAST-NEXT: ret
200-
tail call void @llvm.memset.pattern(ptr %a, i128 %value, i64 1, i1 0)
200+
tail call void @llvm.experimental.memset.pattern(ptr %a, i128 %value, i64 1, i1 0)
201201
ret void
202202
}
203203

@@ -239,7 +239,7 @@ define void @memset_4(ptr %a, i128 %value) nounwind {
239239
; RV64-BOTH-NEXT: bne a0, a3, .LBB2_1
240240
; RV64-BOTH-NEXT: # %bb.2: # %split
241241
; RV64-BOTH-NEXT: ret
242-
tail call void @llvm.memset.pattern(ptr align 8 %a, i128 %value, i64 4, i1 0)
242+
tail call void @llvm.experimental.memset.pattern(ptr align 8 %a, i128 %value, i64 4, i1 0)
243243
ret void
244244
}
245245

@@ -292,6 +292,6 @@ define void @memset_x(ptr %a, i128 %value, i64 %x) nounwind {
292292
; RV64-BOTH-NEXT: bltu a4, a3, .LBB3_2
293293
; RV64-BOTH-NEXT: .LBB3_3: # %split
294294
; RV64-BOTH-NEXT: ret
295-
tail call void @llvm.memset.pattern(ptr align 8 %a, i128 %value, i64 %x, i1 0)
295+
tail call void @llvm.experimental.memset.pattern(ptr align 8 %a, i128 %value, i64 %x, i1 0)
296296
ret void
297297
}

llvm/test/Transforms/PreISelIntrinsicLowering/PowerPC/memset-pattern.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ define void @memset.pattern(ptr %a, i128 %value, i64 %x) nounwind {
1919
; CHECK: [[SPLIT]]:
2020
; CHECK-NEXT: ret void
2121
;
22-
tail call void @llvm.memset.pattern(ptr %a, i128 %value, i64 %x, i1 0)
22+
tail call void @llvm.experimental.memset.pattern(ptr %a, i128 %value, i64 %x, i1 0)
2323
ret void
2424
}

llvm/test/Transforms/PreISelIntrinsicLowering/RISCV/memset-pattern.ll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define void @memset_pattern_i128_1(ptr %a, i128 %value) nounwind {
1515
; CHECK: [[SPLIT]]:
1616
; CHECK-NEXT: ret void
1717
;
18-
tail call void @llvm.memset.pattern(ptr %a, i128 %value, i64 1, i1 0)
18+
tail call void @llvm.experimental.memset.pattern(ptr %a, i128 %value, i64 1, i1 0)
1919
ret void
2020
}
2121

@@ -33,7 +33,7 @@ define void @memset_pattern_i128_16(ptr %a, i128 %value) nounwind {
3333
; CHECK: [[SPLIT]]:
3434
; CHECK-NEXT: ret void
3535
;
36-
tail call void @llvm.memset.pattern(ptr %a, i128 %value, i64 16, i1 0)
36+
tail call void @llvm.experimental.memset.pattern(ptr %a, i128 %value, i64 16, i1 0)
3737
ret void
3838
}
3939

@@ -52,7 +52,7 @@ define void @memset_pattern_i127_x(ptr %a, i127 %value, i64 %x) nounwind {
5252
; CHECK: [[SPLIT]]:
5353
; CHECK-NEXT: ret void
5454
;
55-
tail call void @llvm.memset.pattern(ptr %a, i127 %value, i64 %x, i1 0)
55+
tail call void @llvm.experimental.memset.pattern(ptr %a, i127 %value, i64 %x, i1 0)
5656
ret void
5757
}
5858

@@ -71,7 +71,7 @@ define void @memset_pattern_i128_x(ptr %a, i128 %value, i64 %x) nounwind {
7171
; CHECK: [[SPLIT]]:
7272
; CHECK-NEXT: ret void
7373
;
74-
tail call void @llvm.memset.pattern(ptr %a, i128 %value, i64 %x, i1 0)
74+
tail call void @llvm.experimental.memset.pattern(ptr %a, i128 %value, i64 %x, i1 0)
7575
ret void
7676
}
7777

@@ -90,7 +90,7 @@ define void @memset_pattern_i256_x(ptr %a, i256 %value, i64 %x) nounwind {
9090
; CHECK: [[SPLIT]]:
9191
; CHECK-NEXT: ret void
9292
;
93-
tail call void @llvm.memset.pattern(ptr %a, i256 %value, i64 %x, i1 0)
93+
tail call void @llvm.experimental.memset.pattern(ptr %a, i256 %value, i64 %x, i1 0)
9494
ret void
9595
}
9696

@@ -121,7 +121,7 @@ define void @memset_pattern_i15_x_alignment(ptr %a, i15 %value, i64 %x) nounwind
121121
; CHECK: [[SPLIT1]]:
122122
; CHECK-NEXT: ret void
123123
;
124-
call void @llvm.memset.pattern(ptr align 1 %a, i15 %value, i64 %x, i1 0)
125-
call void @llvm.memset.pattern(ptr align 2 %a, i15 %value, i64 %x, i1 0)
124+
call void @llvm.experimental.memset.pattern(ptr align 1 %a, i15 %value, i64 %x, i1 0)
125+
call void @llvm.experimental.memset.pattern(ptr align 2 %a, i15 %value, i64 %x, i1 0)
126126
ret void
127127
}

llvm/test/Verifier/intrinsic-immarg.ll

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,15 @@ define void @memset_inline_is_volatile(ptr %dest, i8 %value, i1 %is.volatile) {
6363
ret void
6464
}
6565

66-
67-
declare void @llvm.memset.pattern.p0.i32.i32(ptr nocapture, i32, i32, i1)
66+
declare void @llvm.experimental.memset.pattern.p0.i32.i32(ptr nocapture, i32, i32, i1)
6867
define void @memset_pattern_is_volatile(ptr %dest, i32 %value, i1 %is.volatile) {
6968
; CHECK: immarg operand has non-immediate parameter
7069
; CHECK-NEXT: i1 %is.volatile
71-
; CHECK-NEXT: call void @llvm.memset.pattern.p0.i32.i32(ptr %dest, i32 %value, i32 8, i1 %is.volatile)
72-
call void @llvm.memset.pattern.p0.i32.i32(ptr %dest, i32 %value, i32 8, i1 %is.volatile)
70+
; CHECK-NEXT: call void @llvm.experimental.memset.pattern.p0.i32.i32(ptr %dest, i32 %value, i32 8, i1 %is.volatile)
71+
call void @llvm.experimental.memset.pattern.p0.i32.i32(ptr %dest, i32 %value, i32 8, i1 %is.volatile)
7372
ret void
7473
}
7574

76-
7775
declare i64 @llvm.objectsize.i64.p0(ptr, i1, i1, i1)
7876
define void @objectsize(ptr %ptr, i1 %a, i1 %b, i1 %c) {
7977
; CHECK: immarg operand has non-immediate parameter

0 commit comments

Comments
 (0)