Skip to content

Commit f037f41

Browse files
authored
[IR] Add new function attribute nocreateundeforpoison (llvm#164809)
Also add a corresponding intrinsic property that can be used to mark intrinsics that do not introduce poison, for example simple arithmetic intrinsics that propagate poison just like a simple arithmetic instruction. As a smoke test this patch adds the new property to llvm.amdgcn.fmul.legacy.
1 parent f59beca commit f037f41

File tree

31 files changed

+406
-418
lines changed

31 files changed

+406
-418
lines changed

clang/test/CodeGen/X86/math-builtins.c

Lines changed: 162 additions & 160 deletions
Large diffs are not rendered by default.

clang/test/CodeGen/builtin-sqrt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ float foo(float X) {
1111
// HAS_ERRNO-NOT: attributes [[ATTR]] = {{{.*}} memory(none)
1212

1313
// NO_ERRNO: declare float @llvm.sqrt.f32(float) [[ATTR:#[0-9]+]]
14-
// NO_ERRNO: attributes [[ATTR]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
14+
// NO_ERRNO: attributes [[ATTR]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
1515

clang/test/CodeGen/libcalls.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ void test_fma(float a0, double a1, long double a2) {
7474
// CHECK-YES: declare float @fmaf(float noundef, float noundef, float noundef)
7575
// CHECK-YES: declare double @fma(double noundef, double noundef, double noundef)
7676
// CHECK-YES: declare x86_fp80 @fmal(x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef)
77-
// CHECK-NO: declare float @llvm.fma.f32(float, float, float) [[NUW_RN2:#[0-9]+]]
78-
// CHECK-NO: declare double @llvm.fma.f64(double, double, double) [[NUW_RN2]]
79-
// CHECK-NO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[NUW_RN2]]
77+
// CHECK-NO: declare float @llvm.fma.f32(float, float, float) [[NUW_RNI]]
78+
// CHECK-NO: declare double @llvm.fma.f64(double, double, double) [[NUW_RNI]]
79+
// CHECK-NO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[NUW_RNI]]
8080

8181
// Just checking to make sure these library functions are marked readnone
8282
void test_builtins(double d, float f, long double ld) {
@@ -85,19 +85,19 @@ void test_builtins(double d, float f, long double ld) {
8585
double atan_ = atan(d);
8686
long double atanl_ = atanl(ld);
8787
float atanf_ = atanf(f);
88-
// CHECK-NO: declare double @llvm.atan.f64(double) [[NUW_RNI:#[0-9]+]]
89-
// CHECK-NO: declare x86_fp80 @llvm.atan.f80(x86_fp80) [[NUW_RNI]]
90-
// CHECK-NO: declare float @llvm.atan.f32(float) [[NUW_RNI]]
88+
// CHECK-NO: declare double @llvm.atan.f64(double) [[NUW_RN2:#[0-9]+]]
89+
// CHECK-NO: declare x86_fp80 @llvm.atan.f80(x86_fp80) [[NUW_RN2]]
90+
// CHECK-NO: declare float @llvm.atan.f32(float) [[NUW_RN2]]
9191
// CHECK-YES: declare double @atan(double noundef) [[NUW:#[0-9]+]]
9292
// CHECK-YES: declare x86_fp80 @atanl(x86_fp80 noundef) [[NUW]]
9393
// CHECK-YES: declare float @atanf(float noundef) [[NUW]]
9494

9595
double atan2_ = atan2(d, 2);
9696
long double atan2l_ = atan2l(ld, ld);
9797
float atan2f_ = atan2f(f, f);
98-
// CHECK-NO: declare double @llvm.atan2.f64(double, double) [[NUW_RNI]]
99-
// CHECK-NO: declare x86_fp80 @llvm.atan2.f80(x86_fp80, x86_fp80) [[NUW_RNI]]
100-
// CHECK-NO: declare float @llvm.atan2.f32(float, float) [[NUW_RNI]]
98+
// CHECK-NO: declare double @llvm.atan2.f64(double, double) [[NUW_RN2]]
99+
// CHECK-NO: declare x86_fp80 @llvm.atan2.f80(x86_fp80, x86_fp80) [[NUW_RN2]]
100+
// CHECK-NO: declare float @llvm.atan2.f32(float, float) [[NUW_RN2]]
101101
// CHECK-YES: declare double @atan2(double noundef, double noundef) [[NUW]]
102102
// CHECK-YES: declare x86_fp80 @atan2l(x86_fp80 noundef, x86_fp80 noundef) [[NUW]]
103103
// CHECK-YES: declare float @atan2f(float noundef, float noundef) [[NUW]]
@@ -124,4 +124,4 @@ void test_builtins(double d, float f, long double ld) {
124124
}
125125

126126
// CHECK-YES: attributes [[NUW]] = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+x87" }
127-
// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
127+
// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }

clang/test/CodeGen/math-libcalls.c

Lines changed: 117 additions & 115 deletions
Large diffs are not rendered by default.

clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ kernel void device_side_enqueue(global float *a, global float *b, int i) {
199199
// SPIR32: attributes #[[ATTR0]] = { convergent noinline norecurse nounwind optnone "denormal-fp-math-f32"="preserve-sign,preserve-sign" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
200200
// SPIR32: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
201201
// SPIR32: attributes #[[ATTR2]] = { convergent noinline nounwind optnone "denormal-fp-math-f32"="preserve-sign,preserve-sign" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
202-
// SPIR32: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
202+
// SPIR32: attributes #[[ATTR3:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
203203
// SPIR32: attributes #[[ATTR4]] = { convergent nounwind "denormal-fp-math-f32"="preserve-sign,preserve-sign" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
204204
// SPIR32: attributes #[[ATTR5]] = { convergent nounwind "uniform-work-group-size"="true" }
205205
//.

llvm/docs/LangRef.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,11 @@ For example:
27412741
``"nooutline"``
27422742
This attribute indicates that outlining passes should not modify the
27432743
function.
2744+
``nocreateundeforpoison``
2745+
This attribute indicates that the result of the function (prior to
2746+
application of return attributes/metadata) will not be undef or poison if
2747+
all arguments are not undef and not poison. Otherwise, it is undefined
2748+
behavior.
27442749

27452750
Call Site Attributes
27462751
----------------------

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ enum AttributeKindCodes {
801801
ATTR_KIND_CAPTURES = 102,
802802
ATTR_KIND_DEAD_ON_RETURN = 103,
803803
ATTR_KIND_SANITIZE_ALLOC_TOKEN = 104,
804+
ATTR_KIND_NO_CREATE_UNDEF_OR_POISON = 105,
804805
};
805806

806807
enum ComdatSelectionKindCodes {

llvm/include/llvm/IR/Attributes.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ def NoCallback : EnumAttr<"nocallback", IntersectAnd, [FnAttr]>;
183183
/// Specify how the pointer may be captured.
184184
def Captures : IntAttr<"captures", IntersectCustom, [ParamAttr]>;
185185

186+
/// Result will not be undef or poison if all arguments are not undef and not
187+
/// poison.
188+
def NoCreateUndefOrPoison
189+
: EnumAttr<"nocreateundeforpoison", IntersectAnd, [FnAttr]>;
190+
186191
/// Function is not a source of divergence.
187192
def NoDivergenceSource : EnumAttr<"nodivergencesource", IntersectAnd, [FnAttr]>;
188193

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ def IntrSpeculatable : IntrinsicProperty;
186186
// defined by the hasSideEffects property of the TableGen Instruction class.
187187
def IntrHasSideEffects : IntrinsicProperty;
188188

189+
// Result will not be undef or poison if all arguments are not undef and not
190+
// poison.
191+
def IntrNoCreateUndefOrPoison : IntrinsicProperty;
192+
189193
//===----------------------------------------------------------------------===//
190194
// IIT constants and utils
191195
//===----------------------------------------------------------------------===//
@@ -1039,7 +1043,7 @@ def int_experimental_memset_pattern
10391043
// FIXME: Add version of these floating point intrinsics which allow non-default
10401044
// rounding modes and FP exception handling.
10411045

1042-
let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
1046+
let IntrProperties = [IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison] in {
10431047
def int_fma : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
10441048
[LLVMMatchType<0>, LLVMMatchType<0>,
10451049
LLVMMatchType<0>]>;
@@ -1052,16 +1056,8 @@ let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
10521056
// environment so they can be treated as readnone.
10531057
def int_sqrt : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
10541058
def int_powi : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, llvm_anyint_ty]>;
1055-
def int_asin : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1056-
def int_acos : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1057-
def int_atan : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1058-
def int_atan2 : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>]>;
10591059
def int_sin : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
10601060
def int_cos : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1061-
def int_tan : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1062-
def int_sinh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1063-
def int_cosh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1064-
def int_tanh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
10651061
def int_pow : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
10661062
[LLVMMatchType<0>, LLVMMatchType<0>]>;
10671063
def int_log : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
@@ -1080,12 +1076,6 @@ let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
10801076
def int_nearbyint : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
10811077
def int_round : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
10821078
def int_roundeven : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1083-
def int_sincos : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1084-
[llvm_anyfloat_ty]>;
1085-
def int_sincospi : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1086-
[llvm_anyfloat_ty]>;
1087-
def int_modf : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1088-
[llvm_anyfloat_ty]>;
10891079

10901080
// Truncate a floating point number with a specific rounding mode
10911081
def int_fptrunc_round : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ],
@@ -1097,6 +1087,8 @@ let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
10971087
def int_arithmetic_fence : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>],
10981088
[IntrNoMem]>;
10991089

1090+
// If the value doesn't fit an unspecified value is returned, but this
1091+
// is not poison so we can still mark these as IntrNoCreateUndefOrPoison.
11001092
def int_lround : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty]>;
11011093
def int_llround : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty]>;
11021094
def int_lrint : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty]>;
@@ -1110,29 +1102,50 @@ let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
11101102
def int_frexp : DefaultAttrsIntrinsic<[llvm_anyfloat_ty, llvm_anyint_ty], [LLVMMatchType<0>]>;
11111103
}
11121104

1105+
// TODO: Move all of these into the IntrNoCreateUndefOrPoison case above.
1106+
let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
1107+
// These functions do not read memory, but are sensitive to the
1108+
// rounding mode. LLVM purposely does not model changes to the FP
1109+
// environment so they can be treated as readnone.
1110+
def int_asin : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1111+
def int_acos : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1112+
def int_atan : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1113+
def int_atan2 : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>]>;
1114+
def int_tan : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1115+
def int_sinh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1116+
def int_cosh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1117+
def int_tanh : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
1118+
def int_sincos : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1119+
[llvm_anyfloat_ty]>;
1120+
def int_sincospi : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1121+
[llvm_anyfloat_ty]>;
1122+
def int_modf : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
1123+
[llvm_anyfloat_ty]>;
1124+
}
1125+
11131126
def int_minnum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11141127
[LLVMMatchType<0>, LLVMMatchType<0>],
1115-
[IntrNoMem, IntrSpeculatable, Commutative]
1128+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11161129
>;
11171130
def int_maxnum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11181131
[LLVMMatchType<0>, LLVMMatchType<0>],
1119-
[IntrNoMem, IntrSpeculatable, Commutative]
1132+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11201133
>;
11211134
def int_minimum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11221135
[LLVMMatchType<0>, LLVMMatchType<0>],
1123-
[IntrNoMem, IntrSpeculatable, Commutative]
1136+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11241137
>;
11251138
def int_maximum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11261139
[LLVMMatchType<0>, LLVMMatchType<0>],
1127-
[IntrNoMem, IntrSpeculatable, Commutative]
1140+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11281141
>;
11291142
def int_minimumnum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11301143
[LLVMMatchType<0>, LLVMMatchType<0>],
1131-
[IntrNoMem, IntrSpeculatable, Commutative]
1144+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11321145
>;
11331146
def int_maximumnum : DefaultAttrsIntrinsic<[llvm_anyfloat_ty],
11341147
[LLVMMatchType<0>, LLVMMatchType<0>],
1135-
[IntrNoMem, IntrSpeculatable, Commutative]
1148+
[IntrNoMem, IntrSpeculatable, Commutative, IntrNoCreateUndefOrPoison]
11361149
>;
11371150

11381151
// Internal interface for object size checking
@@ -1164,7 +1177,7 @@ let IntrProperties = [IntrInaccessibleMemOnly] in {
11641177
def int_is_fpclass
11651178
: DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
11661179
[llvm_anyfloat_ty, llvm_i32_ty],
1167-
[IntrNoMem, IntrSpeculatable, ImmArg<ArgIndex<1>>]>;
1180+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison, ImmArg<ArgIndex<1>>]>;
11681181

11691182
//===--------------- Constrained Floating Point Intrinsics ----------------===//
11701183
//
@@ -1406,7 +1419,7 @@ def int_expect_with_probability : DefaultAttrsIntrinsic<[llvm_anyint_ty],
14061419
//
14071420

14081421
// None of these intrinsics accesses memory at all.
1409-
let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
1422+
let IntrProperties = [IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison] in {
14101423
def int_bswap: DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>;
14111424
def int_ctpop: DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>;
14121425
def int_bitreverse : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>;
@@ -1521,7 +1534,7 @@ def int_adjust_trampoline : DefaultAttrsIntrinsic<
15211534
//
15221535

15231536
// Expose the carry flag from add operations on two integrals.
1524-
let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
1537+
let IntrProperties = [IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison] in {
15251538
def int_sadd_with_overflow : DefaultAttrsIntrinsic<[llvm_anyint_ty,
15261539
LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
15271540
[LLVMMatchType<0>, LLVMMatchType<0>]>;
@@ -1547,16 +1560,16 @@ let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
15471560
//
15481561
def int_sadd_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty],
15491562
[LLVMMatchType<0>, LLVMMatchType<0>],
1550-
[IntrNoMem, IntrSpeculatable, Commutative]>;
1563+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison, Commutative]>;
15511564
def int_uadd_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty],
15521565
[LLVMMatchType<0>, LLVMMatchType<0>],
1553-
[IntrNoMem, IntrSpeculatable, Commutative]>;
1566+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison, Commutative]>;
15541567
def int_ssub_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty],
15551568
[LLVMMatchType<0>, LLVMMatchType<0>],
1556-
[IntrNoMem, IntrSpeculatable]>;
1569+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
15571570
def int_usub_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty],
15581571
[LLVMMatchType<0>, LLVMMatchType<0>],
1559-
[IntrNoMem, IntrSpeculatable]>;
1572+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
15601573
def int_sshl_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty],
15611574
[LLVMMatchType<0>, LLVMMatchType<0>],
15621575
[IntrNoMem, IntrSpeculatable]>;
@@ -1611,22 +1624,22 @@ def int_abs : DefaultAttrsIntrinsic<
16111624

16121625
def int_smax : DefaultAttrsIntrinsic<
16131626
[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
1614-
[IntrNoMem, IntrSpeculatable]>;
1627+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
16151628
def int_smin : DefaultAttrsIntrinsic<
16161629
[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
1617-
[IntrNoMem, IntrSpeculatable]>;
1630+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
16181631
def int_umax : DefaultAttrsIntrinsic<
16191632
[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
1620-
[IntrNoMem, IntrSpeculatable]>;
1633+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
16211634
def int_umin : DefaultAttrsIntrinsic<
16221635
[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
1623-
[IntrNoMem, IntrSpeculatable]>;
1636+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
16241637
def int_scmp : DefaultAttrsIntrinsic<
16251638
[llvm_anyint_ty], [llvm_anyint_ty, LLVMMatchType<1>],
1626-
[IntrNoMem, IntrSpeculatable, Range<RetIndex, -1, 2>]>;
1639+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison, Range<RetIndex, -1, 2>]>;
16271640
def int_ucmp : DefaultAttrsIntrinsic<
16281641
[llvm_anyint_ty], [llvm_anyint_ty, LLVMMatchType<1>],
1629-
[IntrNoMem, IntrSpeculatable, Range<RetIndex, -1, 2>]>;
1642+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison, Range<RetIndex, -1, 2>]>;
16301643

16311644
//===------------------------- Memory Use Markers -------------------------===//
16321645
//
@@ -1868,7 +1881,7 @@ def int_convert_from_fp16 : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_i16_
18681881
}
18691882

18701883
// Saturating floating point to integer intrinsics
1871-
let IntrProperties = [IntrNoMem, IntrSpeculatable] in {
1884+
let IntrProperties = [IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison] in {
18721885
def int_fptoui_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty]>;
18731886
def int_fptosi_sat : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty]>;
18741887
}
@@ -1890,7 +1903,7 @@ def int_fake_use : DefaultAttrsIntrinsic<[], [llvm_vararg_ty],
18901903
// First argument must be pointer or vector of pointer. This is checked by the
18911904
// verifier.
18921905
def int_ptrmask: DefaultAttrsIntrinsic<[llvm_any_ty], [LLVMMatchType<0>, llvm_anyint_ty],
1893-
[IntrNoMem, IntrSpeculatable]>;
1906+
[IntrNoMem, IntrSpeculatable, IntrNoCreateUndefOrPoison]>;
18941907

18951908
// Intrinsic to wrap a thread local variable.
18961909
def int_threadlocal_address : DefaultAttrsIntrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>],

0 commit comments

Comments
 (0)