Skip to content

Commit 21fb654

Browse files
authored
Fix LLVM 15+ build (rust-lang#818)
* Fix LLVM 15 * Multi version tests * Fix build on 15+
1 parent 609abf3 commit 21fb654

17 files changed

+60
-49
lines changed

enzyme/Enzyme/GradientUtils.cpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ SmallVector<unsigned int, 9> MD_ToCopy = {
116116
LLVMContext::MD_tbaa_struct,
117117
LLVMContext::MD_range,
118118
LLVMContext::MD_nonnull,
119-
#if LLVM_VERSION_MAJOR >= 15
120-
LLVMContext::align,
121-
LLVMContext::noundef,
122-
#endif
123119
LLVMContext::MD_dereferenceable,
124120
LLVMContext::MD_dereferenceable_or_null};
125121

@@ -4611,13 +4607,17 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM,
46114607
AllocaInst *antialloca = bb.CreateAlloca(
46124608
inst->getAllocatedType(), inst->getType()->getPointerAddressSpace(),
46134609
asize, inst->getName() + "'ipa");
4610+
#if LLVM_VERSION_MAJOR >= 11
4611+
antialloca->setAlignment(inst->getAlign());
4612+
#elif LLVM_VERSION_MAJOR == 10
46144613
if (inst->getAlignment()) {
4615-
#if LLVM_VERSION_MAJOR >= 10
46164614
antialloca->setAlignment(Align(inst->getAlignment()));
4615+
}
46174616
#else
4617+
if (inst->getAlignment()) {
46184618
antialloca->setAlignment(inst->getAlignment());
4619-
#endif
46204619
}
4620+
#endif
46214621
return antialloca;
46224622
};
46234623

@@ -4632,13 +4632,17 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM,
46324632
auto rule = [&](Value *antialloca) {
46334633
StoreInst *st = bb.CreateStore(
46344634
Constant::getNullValue(inst->getAllocatedType()), antialloca);
4635+
#if LLVM_VERSION_MAJOR >= 11
4636+
cast<StoreInst>(st)->setAlignment(inst->getAlign());
4637+
#elif LLVM_VERSION_MAJOR == 10
46354638
if (inst->getAlignment()) {
4636-
#if LLVM_VERSION_MAJOR >= 10
46374639
cast<StoreInst>(st)->setAlignment(Align(inst->getAlignment()));
4640+
}
46384641
#else
4642+
if (inst->getAlignment()) {
46394643
cast<StoreInst>(st)->setAlignment(inst->getAlignment());
4640-
#endif
46414644
}
4645+
#endif
46424646
};
46434647

46444648
applyChainRule(bb, rule, antialloca);
@@ -4672,8 +4676,11 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM,
46724676
Type *tys[] = {dst_arg->getType(), len_arg->getType()};
46734677
auto memset = cast<CallInst>(bb.CreateCall(
46744678
Intrinsic::getDeclaration(M, Intrinsic::memset, tys), args));
4675-
#if LLVM_VERSION_MAJOR >= 10
4676-
if (inst->getAlignment()) {
4679+
#if LLVM_VERSION_MAJOR >= 11
4680+
memset->addParamAttr(
4681+
0, Attribute::getWithAlignment(inst->getContext(), inst->getAlign()));
4682+
#elif LLVM_VERSION_MAJOR == 10
4683+
if (inst->getAlignment() != 0) {
46774684
memset->addParamAttr(
46784685
0, Attribute::getWithAlignment(inst->getContext(),
46794686
Align(inst->getAlignment())));
@@ -5614,13 +5621,17 @@ Value *GradientUtils::lookupM(Value *val, IRBuilder<> &BuilderM,
56145621
/*extraSize*/ nullptr);
56155622

56165623
auto ld = v.CreateLoad(AT, AI);
5624+
#if LLVM_VERSION_MAJOR >= 11
5625+
ld->setAlignment(AI->getAlign());
5626+
#elif LLVM_VERSION_MAJOR == 10
56175627
if (AI->getAlignment()) {
5618-
#if LLVM_VERSION_MAJOR >= 10
56195628
ld->setAlignment(Align(AI->getAlignment()));
5629+
}
56205630
#else
5631+
if (AI->getAlignment()) {
56215632
ld->setAlignment(AI->getAlignment());
5622-
#endif
56235633
}
5634+
#endif
56245635
scopeInstructions[cache].push_back(ld);
56255636
auto st = v.CreateStore(ld, outer);
56265637
auto bsize = newFunc->getParent()

enzyme/test/Enzyme/BatchMode/intsum.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ declare [4 x float] @__enzyme_batch(...)
7474
; CHECK-NEXT: %lcssa = phi float [ %add1, %do.body ]
7575
; CHECK-NEXT: %lcssa3 = phi float [ %add2, %do.body ]
7676
; CHECK-NEXT: %lcssa4 = phi float [ %add3, %do.body ]
77-
; CHECK-NEXT: %mrv = insertvalue [4 x float] undef, float %lcssa0, 0
77+
; CHECK-NEXT: %mrv = insertvalue [4 x float] {{(undef|poison)?}}, float %lcssa0, 0
7878
; CHECK-NEXT: %mrv5 = insertvalue [4 x float] %mrv, float %lcssa, 1
7979
; CHECK-NEXT: %mrv6 = insertvalue [4 x float] %mrv5, float %lcssa3, 2
8080
; CHECK-NEXT: %mrv7 = insertvalue [4 x float] %mrv6, float %lcssa4, 3
8181
; CHECK-NEXT: ret [4 x float] %mrv7
82-
; CHECK-NEXT: }
82+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/log.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ entry:
2626
; CHECK-NEXT: %1 = tail call fast double @llvm.log.f64(double %x2)
2727
; CHECK-NEXT: %2 = tail call fast double @llvm.log.f64(double %x3)
2828
; CHECK-NEXT: %3 = tail call fast double @llvm.log.f64(double %x4)
29-
; CHECK-NEXT: %mrv.i = insertvalue [4 x double] undef, double %0, 0
29+
; CHECK-NEXT: %mrv.i = insertvalue [4 x double] {{(undef|poison)}}, double %0, 0
3030
; CHECK-NEXT: %mrv1.i = insertvalue [4 x double] %mrv.i, double %1, 1
3131
; CHECK-NEXT: %mrv2.i = insertvalue [4 x double] %mrv1.i, double %2, 2
3232
; CHECK-NEXT: %mrv3.i = insertvalue [4 x double] %mrv2.i, double %3, 3
3333
; CHECK-NEXT: ret [4 x double] %mrv3.i
34-
; CHECK-NEXT: }
34+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/relu.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ declare [4 x double] @__enzyme_batch(...)
3636
; CHECK-NEXT: %ax1 = fmul double %x, %unwrap.a1
3737
; CHECK-NEXT: %ax2 = fmul double %x, %unwrap.a2
3838
; CHECK-NEXT: %ax3 = fmul double %x, %unwrap.a3
39-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %ax0, 0
39+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %ax0, 0
4040
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %ax1, 1
4141
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %ax2, 2
4242
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %ax3, 3
4343
; CHECK-NEXT: ret [4 x double] %mrv3
4444

4545
; CHECK: cond.end: ; preds = %entry
46-
; CHECK-NEXT: %mrv4 = insertvalue [4 x double] undef, double %x, 0
46+
; CHECK-NEXT: %mrv4 = insertvalue [4 x double] {{(undef|poison)?}}, double %x, 0
4747
; CHECK-NEXT: %mrv5 = insertvalue [4 x double] %mrv4, double %x, 1
4848
; CHECK-NEXT: %mrv6 = insertvalue [4 x double] %mrv5, double %x, 2
4949
; CHECK-NEXT: %mrv7 = insertvalue [4 x double] %mrv6, double %x, 3
5050
; CHECK-NEXT: ret [4 x double] %mrv7
51-
; CHECK-NEXT: }
51+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/scalar-call.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ entry:
3737
; CHECK-NEXT: %mul1 = fmul double %unwrap.x1, %unwrap.call1
3838
; CHECK-NEXT: %mul2 = fmul double %unwrap.x2, %unwrap.call2
3939
; CHECK-NEXT: %mul3 = fmul double %unwrap.x3, %unwrap.call3
40-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %mul0, 0
40+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %mul0, 0
4141
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %mul1, 1
4242
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %mul2, 2
4343
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %mul3, 3
@@ -47,9 +47,9 @@ entry:
4747
; CHECK: define internal [4 x double] @batch_add3(double %x, double %a)
4848
; CHECK-NEXT: entry:
4949
; CHECK-NEXT: %add = fadd double %x, %a
50-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %add, 0
50+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %add, 0
5151
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %add, 1
5252
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %add, 2
5353
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %add, 3
5454
; CHECK-NEXT: ret [4 x double] %mrv3
55-
; CHECK-NEXT: }
55+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/square-scalar-add.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ entry:
3030
; CHECK-NEXT: %add1 = fadd double %mul1, %y
3131
; CHECK-NEXT: %add2 = fadd double %mul2, %y
3232
; CHECK-NEXT: %add3 = fadd double %mul3, %y
33-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %add0, 0
33+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %add0, 0
3434
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %add1, 1
3535
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %add2, 2
3636
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %add3, 3
3737
; CHECK-NEXT: ret [4 x double] %mrv3
38-
; CHECK-NEXT: }
38+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/square-scalar.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ entry:
1818
; CHECK: define internal [4 x double] @batch_square(double %x)
1919
; CHECK-NEXT: entry:
2020
; CHECK-NEXT: %mul = fmul double %x, %x
21-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %mul, 0
21+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %mul, 0
2222
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %mul, 1
2323
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %mul, 2
2424
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %mul, 3
2525
; CHECK-NEXT: ret [4 x double] %mrv3
26-
; CHECK-NEXT: }
26+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/square-vector.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ entry:
2525
; CHECK-NEXT: %mul1 = fmul double %unwrap.x1, %unwrap.x1
2626
; CHECK-NEXT: %mul2 = fmul double %unwrap.x2, %unwrap.x2
2727
; CHECK-NEXT: %mul3 = fmul double %unwrap.x3, %unwrap.x3
28-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %mul0, 0
28+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %mul0, 0
2929
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %mul1, 1
3030
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %mul2, 2
3131
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %mul3, 3
3232
; CHECK-NEXT: ret [4 x double] %mrv3
33-
; CHECK-NEXT: }
33+
; CHECK-NEXT: }

enzyme/test/Enzyme/BatchMode/vector-call.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ entry:
4242
; CHECK-NEXT: %unwrap.call1 = extractvalue [4 x double] %call, 1
4343
; CHECK-NEXT: %unwrap.call2 = extractvalue [4 x double] %call, 2
4444
; CHECK-NEXT: %unwrap.call3 = extractvalue [4 x double] %call, 3
45-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %unwrap.call0, 0
45+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %unwrap.call0, 0
4646
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %unwrap.call1, 1
4747
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %unwrap.call2, 2
4848
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %unwrap.call3, 3
@@ -59,9 +59,9 @@ entry:
5959
; CHECK-NEXT: %add1 = fadd double %unwrap.x1, %a
6060
; CHECK-NEXT: %add2 = fadd double %unwrap.x2, %a
6161
; CHECK-NEXT: %add3 = fadd double %unwrap.x3, %a
62-
; CHECK-NEXT: %mrv = insertvalue [4 x double] undef, double %add0, 0
62+
; CHECK-NEXT: %mrv = insertvalue [4 x double] {{(undef|poison)?}}, double %add0, 0
6363
; CHECK-NEXT: %mrv1 = insertvalue [4 x double] %mrv, double %add1, 1
6464
; CHECK-NEXT: %mrv2 = insertvalue [4 x double] %mrv1, double %add2, 2
6565
; CHECK-NEXT: %mrv3 = insertvalue [4 x double] %mrv2, double %add3, 3
6666
; CHECK-NEXT: ret [4 x double] %mrv3
67-
; CHECK-NEXT: }
67+
; CHECK-NEXT: }

enzyme/test/Enzyme/ReverseMode/cppllist.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ attributes #8 = { builtin nounwind }
217217
; CHECK-NEXT: store double 0.000000e+00, double* %[[bcast]]
218218
; CHECK-NEXT: %[[xadd]] = fadd fast double %"x'de.0.i", %[[load]]
219219
; this reload really should be eliminated
220-
; CHECK-NEXT: call void @_ZdlPv(i8* nonnull %[[metaload]]) #5
220+
; CHECK-NEXT: call void @_ZdlPv(i8* nonnull %[[metaload]])
221221
; CHECK-NEXT: %[[heregep:.+]] = getelementptr inbounds i8*, i8** %call_malloccache.i, i64 %[[antivar]]
222222
; CHECK-NEXT: %[[callload2free:.+]] = load i8*, i8** %[[heregep]]
223-
; CHECK-NEXT: call void @_ZdlPv(i8* %[[callload2free]]) #5
223+
; CHECK-NEXT: call void @_ZdlPv(i8* %[[callload2free]])
224224
; CHECK-NEXT: %[[cmpinst:.+]] = icmp eq i64 %[[antivar]], 0
225225
; CHECK-NEXT: br i1 %[[cmpinst]], label %diffe_Z12list_creatordm.exit, label %incinvertfor.body.i
226226

@@ -229,8 +229,8 @@ attributes #8 = { builtin nounwind }
229229
; CHECK-NEXT: br label %invertfor.body.i
230230

231231
; CHECK: diffe_Z12list_creatordm.exit: ; preds = %invertfor.body.i
232-
; CHECK-NEXT: call void @free(i8* nonnull %malloccall.i) #5
233-
; CHECK-NEXT: call void @free(i8* nonnull %[[call_malloc]]) #5
232+
; CHECK-NEXT: call void @free(i8* nonnull %malloccall.i)
233+
; CHECK-NEXT: call void @free(i8* nonnull %[[call_malloc]])
234234
; CHECK-NEXT: ret double %[[xadd]]
235235
; CHECK-NEXT: }
236236

enzyme/test/Enzyme/ReverseMode/llist.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ attributes #4 = { nounwind }
8686
; CHECK-NEXT: entry:
8787
; CHECK-NEXT: %[[n8:.+]] = shl i64 %n, 3
8888
; CHECK-NEXT: %mallocsize.i = add i64 %[[n8]], 8
89-
; CHECK-NEXT: %[[mallocp:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
89+
; CHECK-NEXT: %[[mallocp:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
9090
; CHECK-NEXT: %[[callpcache:.+]] = bitcast i8* %[[mallocp]] to i8**
91-
; CHECK-NEXT: %[[malloc1:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
91+
; CHECK-NEXT: %[[malloc1:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
9292
; CHECK-NEXT: %call_malloccache.i = bitcast i8* %[[malloc1:.+]] to i8**
9393
; CHECK-NEXT: br label %for.body.i
9494

@@ -104,7 +104,7 @@ attributes #4 = { nounwind }
104104
; CHECK-NEXT: %call.i = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
105105

106106
; CHECK-NEXT: %"call'mi.i" = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
107-
; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* {{(noundef )?}}nonnull {{(align 1 )?}}dereferenceable(16) dereferenceable_or_null(16) %"call'mi.i", i8 0, i64 16, {{(i32 1, )?}}i1 false) #4
107+
; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* {{(noundef )?}}nonnull {{(align 1 )?}}dereferenceable(16) dereferenceable_or_null(16) %"call'mi.i", i8 0, i64 16, {{(i32 1, )?}}i1 false)
108108

109109
; CHECK-NEXT: %[[dstructncast]] = bitcast i8* %"call'mi.i" to %struct.n*
110110
; CHECK-NEXT: %[[thisbc]] = bitcast i8* %call.i to %struct.n*

enzyme/test/Enzyme/ReverseMode/nllist.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ attributes #4 = { nounwind }
198198
; CHECK-NEXT: %mul.i = add i64 %add.i, 8
199199
; CHECK-NEXT: %0 = shl i64 %n, 3
200200
; CHECK-NEXT: %mallocsize.i = add i64 %0, 8
201-
; CHECK-NEXT: %[[mallocforcall2p:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
201+
; CHECK-NEXT: %[[mallocforcall2p:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
202202
; CHECK-NEXT: %"call2'mi_malloccache.i" = bitcast i8* %[[mallocforcall2p]] to i8**
203-
; CHECK-NEXT: %[[mallocforcall2:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
203+
; CHECK-NEXT: %[[mallocforcall2:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
204204
; CHECK-NEXT: %call2_malloccache.i = bitcast i8* %[[mallocforcall2]] to i8**
205-
; CHECK-NEXT: %[[mallocforcallp:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
205+
; CHECK-NEXT: %[[mallocforcallp:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
206206
; CHECK-NEXT: %"call'mi_malloccache.i" = bitcast i8* %[[mallocforcallp:.+]] to i8**
207-
; CHECK-NEXT: %[[mcall2:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i) #4
207+
; CHECK-NEXT: %[[mcall2:.+]] = call noalias nonnull i8* @malloc(i64 %mallocsize.i)
208208
; CHECK-NEXT: %call_malloccache.i = bitcast i8* %[[mcall2]] to i8**
209209
; CHECK-NEXT: br label %for.body.i
210210

211211
; CHECK: [[invertforcondcleanup:.+]]: ; preds = %for.cond.cleanup7.i
212-
; CHECK-NEXT: call void @diffesum_list(%struct.n* nonnull %[[bccast:.+]], %struct.n* nonnull %[[ipci:.+]], i64 %times, double 1.000000e+00) #4
212+
; CHECK-NEXT: call void @diffesum_list(%struct.n* nonnull %[[bccast:.+]], %struct.n* nonnull %[[ipci:.+]], i64 %times, double 1.000000e+00)
213213
; CHECK-NEXT: br label %invertfor.cond.cleanup7.i
214214

215215
; CHECK: for.body.i: ; preds = %for.cond.cleanup7.i, %entry
@@ -219,7 +219,7 @@ attributes #4 = { nounwind }
219219
; CHECK-NEXT: %[[nextvar]] = add nuw nsw i64 %[[iv]], 1
220220
; CHECK-NEXT: %call.i = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
221221
; CHECK-NEXT: %"call'mi.i" = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
222-
; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* {{(noundef )?}}nonnull {{(align 1 )?}}dereferenceable(16) dereferenceable_or_null(16) %"call'mi.i", i8 0, i64 16, {{(i32 1, )?}}i1 false) #4
222+
; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* {{(noundef )?}}nonnull {{(align 1 )?}}dereferenceable(16) dereferenceable_or_null(16) %"call'mi.i", i8 0, i64 16, {{(i32 1, )?}}i1 false)
223223
; CHECK-NEXT: %[[nextipgi:.+]] = getelementptr inbounds i8, i8* %"call'mi.i", i64 8
224224
; CHECK-NEXT: %next.i = getelementptr inbounds i8, i8* %call.i, i64 8
225225
; CHECK-NEXT: %[[thisipc:.+]] = bitcast i8* %[[nextipgi]] to %struct.n**

enzyme/test/Enzyme/ReverseMode/ompsqloopPostOpt.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ attributes #1 = { argmemonly }
118118
; CHECK-NOT: call{{.*}}@malloc
119119
; CHECK: }
120120

121-
; CHECK-LABEL: define internal void @diffe.omp_outlined.(i32* noalias nocapture readonly %.global_tid., i32* noalias nocapture readnone %.bound_tid., i64 %length, double* nocapture nonnull readnone align 8 dereferenceable(8) %tmp, double* nocapture %"tmp'", double** nocapture readonly %tapeArg)
121+
; CHECK-LABEL: define internal void @diffe.omp_outlined.(i32* noalias nocapture readonly %.global_tid., i32* noalias nocapture readnone %.bound_tid., i64 %length, double* nocapture nonnull readnone align 8 {{(dereferenceable\(8\) )?}}%tmp, double* nocapture %"tmp'", double** nocapture readonly %tapeArg)
122122
; CHECK-NOT: call{{.*}}@free
123123
; CHECK: }

enzyme/test/Enzyme/ReverseMode/sumnllist.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ attributes #4 = { nounwind }
177177
; LLVM14-NEXT: %[[arraytostore:.+]] = fadd fast double %[[arrayload]], %"add'de.0"
178178
; SHARED-NEXT: store double %[[arraytostore]], double* %[[arrayidxipg]]
179179
; SHARED-NEXT: %[[endcond:.+]] = icmp eq i64 %[[mantivar]], 0
180-
; LLVM14-NEXT: %22 = select i1 %21, double %"add'de.0", double -0.000000e+00
180+
; LLVM14-NEXT: %22 = select {{(fast )?}}i1 %21, double %"add'de.0", double {{\-?}}0.000000e+00
181181
; LLVM14-NEXT: %23 = fadd fast double %"sum.019'de.1", %22
182182
; SHARED-NEXT: br i1 %[[endcond]], label %invertfor.cond1.preheader, label %incinvertfor.body5
183183

enzyme/test/Enzyme/ReverseMode/sumsimple.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ attributes #0 = { noinline nounwind uwtable }
3838

3939
; CHECK: define internal {{(dso_local )?}}void @diffef(double* %x, double* %"x'", double** %y, double** %"y'", i64 %n)
4040
; CHECK-NEXT: entry:
41-
; CHECK-NEXT: %0 = add i64 %n, 1
41+
; CHECK-NEXT: %0 = add {{(nuw )?}}i64 %n, 1
4242
; CHECK-NEXT: %1 = add nuw i64 %0, 1
4343
; CHECK-NEXT: %mallocsize = mul nuw nsw i64 %1, 8
4444
; CHECK-NEXT: %malloccall = tail call noalias nonnull i8* @malloc(i64 %mallocsize)

enzyme/test/Enzyme/ReverseMode/sumsimpleoptnone.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ attributes #0 = { noinline nounwind uwtable optnone }
3838

3939
; CHECK: define internal {{(dso_local )?}}void @diffef(double* %x, double* %"x'", double** %y, double** %"y'", i64 %n)
4040
; CHECK-NEXT: entry:
41-
; CHECK-NEXT: %0 = add i64 %n, 1
41+
; CHECK-NEXT: %0 = add {{(nuw )?}}i64 %n, 1
4242
; CHECK-NEXT: %1 = add nuw i64 %0, 1
4343
; CHECK-NEXT: %mallocsize = mul nuw nsw i64 %1, 8
4444
; CHECK-NEXT: %malloccall = tail call noalias nonnull i8* @malloc(i64 %mallocsize)

enzyme/test/Enzyme/ReverseMode/unwrapload.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ declare dso_local double @__enzyme_autodiff(i8*, double*, double*, i64*)
169169
; SHARED-NEXT: %[[eq:.+]] = icmp eq i64 %"iv1'ac.0", 0
170170
; SHARED-NEXT: %[[dadd]] = select{{( fast)?}} i1 %[[eq]], double 0.000000e+00, double %"add'de.0"
171171
; LLVM13-NEXT: %[[fdadd:.+]] = fadd fast double %"res1'de.0", %"add'de.0"
172-
; LLVM14-NEXT: %[[fdadd:.+]] = select i1 %[[eq]], double %"add'de.0", double -0.000000e+00
172+
; LLVM14-NEXT: %[[fdadd:.+]] = select {{(fast )?}}i1 %[[eq]], double %"add'de.0", double {{\-?}}0.000000e+00
173173
; LLVM13-NEXT: %[[dres]] = select{{( fast)?}} i1 %[[eq]], double %[[fdadd]], double %"res1'de.0"
174174
; LLVM14-NEXT: %[[dres]] = fadd fast double %"res1'de.0", %[[fdadd]]
175175
; SHARED-NEXT: br i1 %[[eq]], label %invertloop1, label %invertloop2

0 commit comments

Comments
 (0)