From: David Majnemer Date: Thu, 4 Jun 2015 07:21:42 +0000 (+0000) Subject: Make the test introduced in r239015 more targeted. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7464cac57223d9e63630a3e367142ad4cd2c38d4;p=oota-llvm.git Make the test introduced in r239015 more targeted. We don't need to go through LSR to trigger this bug. Instead, hand-craft a tricky GEP and get the constant folder to hack on it when parsing the IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239017 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Assembler/getelementptr.ll b/test/Assembler/getelementptr.ll index ee88346eb00..0a0fddfc4dd 100644 --- a/test/Assembler/getelementptr.ll +++ b/test/Assembler/getelementptr.ll @@ -19,6 +19,10 @@ @y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0) ; CHECK: @y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0) +@PR23753_a = external global i8 +@PR23753_b = global i8* getelementptr (i8, i8* @PR23753_a, i64 ptrtoint (i8* @PR23753_a to i64)) +; CHECK: @PR23753_b = global i8* getelementptr (i8, i8* @PR23753_a, i64 ptrtoint (i8* @PR23753_a to i64)) + ; See if i92 indices work too. define i32 *@test({i32, i32}* %t, i92 %n) { ; CHECK: @test diff --git a/test/Transforms/LoopStrengthReduce/pr23753.ll b/test/Transforms/LoopStrengthReduce/pr23753.ll deleted file mode 100644 index a6a34b1dfd8..00000000000 --- a/test/Transforms/LoopStrengthReduce/pr23753.ll +++ /dev/null @@ -1,29 +0,0 @@ -; RUN: opt < %s -loop-reduce -S | FileCheck %s - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@a = external global i32, align 4 -@d = external global i8, align 1 - -; CHECK-LABEL: void @f -define void @f() { -entry: - br label %for.body - -for.body: - %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32, i32* @a, i64 %indvars.iv - %cmp = icmp ne i32* %arrayidx, bitcast (i8* @d to i32*) - %indvars.iv.next = add i64 %indvars.iv, 1 - br i1 %cmp, label %for.body, label %for.end - -; CHECK: %[[phi:.*]] = phi i8* [ %[[gep:.*]], {{.*}} ], [ getelementptr (i8, i8* @d, i64 sub (i64 4, i64 ptrtoint (i32* @a to i64))), {{.*}} ] -; CHECK-NEXT: %[[gep]] = getelementptr i8, i8* %[[phi]], i64 -4 -; CHECK-NEXT: %[[cst:.*]] = bitcast i8* %[[gep]] to i32* -; CHECK-NEXT: %[[cmp:.*]] = icmp ne i32* %[[cst]], null -; CHECK-NEXT: br i1 %[[cmp]] - -for.end: - ret void -}