summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVersioning/lcssa.ll
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2018-07-09 22:27:23 +0000
committerManoj Gupta <manojgupta@google.com>2018-07-09 22:27:23 +0000
commit77eeac3d9e9418ac0aea131d20ac84b656977814 (patch)
tree0ca98362b1ae59875a26b0df269bf09a1854d982 /llvm/test/Transforms/LoopVersioning/lcssa.ll
parent0230f7c763c5b5f988f629506f0ce050fbacaed4 (diff)
downloadbcm5719-llvm-77eeac3d9e9418ac0aea131d20ac84b656977814.tar.gz
bcm5719-llvm-77eeac3d9e9418ac0aea131d20ac84b656977814.zip
llvm: Add support for "-fno-delete-null-pointer-checks"
Summary: Support for this option is needed for building Linux kernel. This is a very frequently requested feature by kernel developers. More details : https://lkml.org/lkml/2018/4/4/601 GCC option description for -fdelete-null-pointer-checks: This Assume that programs cannot safely dereference null pointers, and that no code or data element resides at address zero. -fno-delete-null-pointer-checks is the inverse of this implying that null pointer dereferencing is not undefined. This feature is implemented in LLVM IR in this CL as the function attribute "null-pointer-is-valid"="true" in IR (Under review at D47894). The CL updates several passes that assumed null pointer dereferencing is undefined to not optimize when the "null-pointer-is-valid"="true" attribute is present. Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv Reviewed By: efriedma, george.burgess.iv Subscribers: eraman, haicheng, george.burgess.iv, drinkcat, theraven, reames, sanjoy, xbolva00, llvm-commits Differential Revision: https://reviews.llvm.org/D47895 llvm-svn: 336613
Diffstat (limited to 'llvm/test/Transforms/LoopVersioning/lcssa.ll')
-rw-r--r--llvm/test/Transforms/LoopVersioning/lcssa.ll37
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVersioning/lcssa.ll b/llvm/test/Transforms/LoopVersioning/lcssa.ll
index 2cd4662c371..64993061008 100644
--- a/llvm/test/Transforms/LoopVersioning/lcssa.ll
+++ b/llvm/test/Transforms/LoopVersioning/lcssa.ll
@@ -33,3 +33,40 @@ bb3.loopexit:
bb3:
ret void
}
+
+define void @fill_no_null_opt(i8** %ls1.20, i8** %ls2.21, i8* %cse3.22) #0 {
+; CHECK-LABEL: fill_no_null_opt(
+; CHECK: bb1.lver.check:
+; CHECK: %lver.safe = or i1 %memcheck.conflict, %{{.*}}
+; CHECK: br i1 %lver.safe, label %bb1.ph.lver.orig, label %bb1.ph
+bb1.ph:
+ %ls1.20.promoted = load i8*, i8** %ls1.20
+ %ls2.21.promoted = load i8*, i8** %ls2.21
+ br label %bb1
+
+bb1:
+ %_tmp302 = phi i8* [ %ls2.21.promoted, %bb1.ph ], [ %_tmp30, %bb1 ]
+ %_tmp281 = phi i8* [ %ls1.20.promoted, %bb1.ph ], [ %_tmp28, %bb1 ]
+ %_tmp14 = getelementptr i8, i8* %_tmp281, i16 -1
+ %_tmp15 = load i8, i8* %_tmp14
+ %add = add i8 %_tmp15, 1
+ store i8 %add, i8* %_tmp281
+ store i8 %add, i8* %_tmp302
+ %_tmp28 = getelementptr i8, i8* %_tmp281, i16 1
+ %_tmp30 = getelementptr i8, i8* %_tmp302, i16 1
+ br i1 false, label %bb1, label %bb3.loopexit
+
+bb3.loopexit:
+ %_tmp30.lcssa = phi i8* [ %_tmp30, %bb1 ]
+ %_tmp15.lcssa = phi i8 [ %_tmp15, %bb1 ]
+ %_tmp28.lcssa = phi i8* [ %_tmp28, %bb1 ]
+ store i8* %_tmp28.lcssa, i8** %ls1.20
+ store i8 %_tmp15.lcssa, i8* %cse3.22
+ store i8* %_tmp30.lcssa, i8** %ls2.21
+ br label %bb3
+
+bb3:
+ ret void
+}
+
+attributes #0 = { "null-pointer-is-valid"="true" }
OpenPOWER on IntegriCloud