X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FXCore%2Fthreads.ll;h=0c25314295d77c58245f0fb5c4a0643ab35bb6be;hb=813f44a29fd0fd140127023222d0633e23783bcc;hp=b56b16b5fa9da27936a1e0c11dbea3ce357e77d8;hpb=71537c178303c9d3f44aa0b9e0de167a7d670c77;p=oota-llvm.git diff --git a/test/CodeGen/XCore/threads.ll b/test/CodeGen/XCore/threads.ll index b56b16b5fa9..0c25314295d 100644 --- a/test/CodeGen/XCore/threads.ll +++ b/test/CodeGen/XCore/threads.ll @@ -1,4 +1,5 @@ ; RUN: llc -march=xcore < %s | FileCheck %s +; RUN: llc -march=xcore -O=0 < %s | FileCheck %s -check-prefix=PHINODE declare i8 addrspace(1)* @llvm.xcore.getst.p1i8.p1i8(i8 addrspace(1)* %r) declare void @llvm.xcore.msync.p1i8(i8 addrspace(1)* %r) @@ -77,7 +78,7 @@ define i32* @f_tl() { ; CHECK: ldc [[R2:r[0-9]]], 12 ; r0 = id*12 + 8 + &tl ; CHECK: lmul {{r[0-9]}}, r0, r11, [[R2]], [[R0]], [[R1]] - ret i32* getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 2) + ret i32* getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 2) } define i32* @f_tle() { @@ -87,7 +88,7 @@ define i32* @f_tle() { ; CHECK: ldaw [[R1:r[0-9]]], dp[tle] ; r0 = &tl + id*8 ; CHECK: add r0, [[R1]], [[R0]] - ret i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) + ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) } define i32 @f_tlExpr () { @@ -98,8 +99,46 @@ define i32 @f_tlExpr () { ; CHECK: add [[R2:r[0-9]]], [[R1]], [[R0]] ; CHECK: add r0, [[R2]], [[R2]] ret i32 add( - i32 ptrtoint( i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) to i32), - i32 ptrtoint( i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) to i32)) + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32), + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32)) +} + +define void @phiNode1() { +; N.B. lowering of duplicate constexpr in a PHI node requires -O=0 +; PHINODE-LABEL: phiNode1: +; PHINODE: get r11, id +; PHINODE-LABEL: .LBB11_1: +; PHINODE: get r11, id +; PHINODE: bu .LBB11_1 +entry: + br label %ConstantExpPhiNode +ConstantExpPhiNode: + %ptr = phi i32* [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %entry ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] + br label %ConstantExpPhiNode +exit: + ret void +} + +define void @phiNode2( i1 %bool) { +; N.B. check an extra 'Node_crit_edge' (LBB12_1) is inserted +; PHINODE-LABEL: phiNode2: +; PHINODE: bf {{r[0-9]}}, .LBB12_3 +; PHINODE: bu .LBB12_1 +; PHINODE-LABEL: .LBB12_1: +; PHINODE: get r11, id +; PHINODE-LABEL: .LBB12_2: +; PHINODE: get r11, id +; PHINODE: bu .LBB12_2 +; PHINODE-LABEL: .LBB12_3: +entry: + br i1 %bool, label %ConstantExpPhiNode, label %exit +ConstantExpPhiNode: + %ptr = phi i32* [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %entry ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] + br label %ConstantExpPhiNode +exit: + ret void } ; CHECK-LABEL: tl: