diff polly/test/ScopInfo/truncate-3.ll @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 1f2b6ac9f198
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/polly/test/ScopInfo/truncate-3.ll	Thu Feb 13 15:10:13 2020 +0900
@@ -0,0 +1,26 @@
+; RUN: opt %loadPolly -polly-scops -pass-remarks-analysis="polly-scops" \
+; RUN:                -disable-output < %s 2>&1 | FileCheck %s
+
+; CHECK: Signed-unsigned restriction: [p] -> {  : p <= -129 or p >= 128 }
+
+; Verify that this test case does not crash when we try to model it.
+; At some point we tried to insert a restriction:
+;                                      [p] -> {  : p <= -129 or p >= 128 }
+; which resulted in a crash.
+
+target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
+
+define void @wobble(i16* %A, i32 %p) {
+bb:
+  %tmp1 = and i32 %p, 255
+  br label %bb4
+
+bb4:                                              ; preds = %bb4, %bb
+  %indvar = phi i16* [ %A, %bb ], [ %indvar.next, %bb4 ]
+  %val = load i16, i16* %indvar
+  %indvar.next = getelementptr inbounds i16, i16* %indvar, i32 %tmp1
+  br i1 false, label %bb4, label %bb9
+
+bb9:                                              ; preds = %bb4
+  ret void
+}