diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -3168,12 +3168,12 @@ .addReg(ScratchReg1) .add(predOps(ARMCC::AL)); - // This jump is taken if StackLimit < SP - stack required. + // This jump is taken if StackLimit <= SP - stack required. Opcode = Thumb ? ARM::tBcc : ARM::Bcc; - BuildMI(GetMBB, DL, TII.get(Opcode)).addMBB(PostStackMBB) - .addImm(ARMCC::LO) - .addReg(ARM::CPSR); - + BuildMI(GetMBB, DL, TII.get(Opcode)) + .addMBB(PostStackMBB) + .addImm(ARMCC::LS) + .addReg(ARM::CPSR); // Calling __morestack(StackSize, Size of stack arguments). // __morestack knows that the stack size requested is in SR0(r4) diff --git a/llvm/test/CodeGen/ARM/debug-segmented-stacks.ll b/llvm/test/CodeGen/ARM/debug-segmented-stacks.ll --- a/llvm/test/CodeGen/ARM/debug-segmented-stacks.ll +++ b/llvm/test/CodeGen/ARM/debug-segmented-stacks.ll @@ -20,7 +20,7 @@ ; ARM-linux-NEXT: mov r5, sp ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB0_2 +; ARM-linux-NEXT: bls .LBB0_2 ; ARM-linux: mov r4, #48 ; ARM-linux-NEXT: mov r5, #0 diff --git a/llvm/test/CodeGen/ARM/segmented-stacks-dynamic.ll b/llvm/test/CodeGen/ARM/segmented-stacks-dynamic.ll --- a/llvm/test/CodeGen/ARM/segmented-stacks-dynamic.ll +++ b/llvm/test/CodeGen/ARM/segmented-stacks-dynamic.ll @@ -27,7 +27,7 @@ ; ARM-linux-NEXT: mov r5, sp ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB0_2 +; ARM-linux-NEXT: bls .LBB0_2 ; ARM-linux: mov r4, #16 ; ARM-linux-NEXT: mov r5, #0 @@ -47,7 +47,7 @@ ; ARM-android-NEXT: mov r5, sp ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB0_2 +; ARM-android-NEXT: bls .LBB0_2 ; ARM-android: mov r4, #16 ; ARM-android-NEXT: mov r5, #0 diff --git a/llvm/test/CodeGen/ARM/segmented-stacks.ll b/llvm/test/CodeGen/ARM/segmented-stacks.ll --- a/llvm/test/CodeGen/ARM/segmented-stacks.ll +++ b/llvm/test/CodeGen/ARM/segmented-stacks.ll @@ -21,7 +21,7 @@ ; ARM-linux-NEXT: mov r5, sp ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB0_2 +; ARM-linux-NEXT: bls .LBB0_2 ; ARM-linux: mov r4, #48 ; ARM-linux-NEXT: mov r5, #0 @@ -40,7 +40,7 @@ ; ARM-android-NEXT: mov r5, sp ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB0_2 +; ARM-android-NEXT: bls .LBB0_2 ; ARM-android: mov r4, #48 ; ARM-android-NEXT: mov r5, #0 @@ -68,7 +68,7 @@ ; ARM-linux-NEXT: mov r5, sp ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB1_2 +; ARM-linux-NEXT: bls .LBB1_2 ; ARM-linux: mov r4, #56 ; ARM-linux-NEXT: mov r5, #0 @@ -87,7 +87,7 @@ ; ARM-android-NEXT: mov r5, sp ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB1_2 +; ARM-android-NEXT: bls .LBB1_2 ; ARM-android: mov r4, #56 ; ARM-android-NEXT: mov r5, #0 @@ -114,7 +114,7 @@ ; ARM-linux-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB2_2 +; ARM-linux-NEXT: bls .LBB2_2 ; ARM-linux: ldr r4, .LCPI2_0 ; ARM-linux-NEXT: mov r5, #0 @@ -137,7 +137,7 @@ ; ARM-android-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB2_2 +; ARM-android-NEXT: bls .LBB2_2 ; ARM-android: ldr r4, .LCPI2_0 ; ARM-android-NEXT: mov r5, #0 @@ -166,7 +166,7 @@ ; ARM-linux-NEXT: mov r5, sp ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB3_2 +; ARM-linux-NEXT: bls .LBB3_2 ; ARM-linux: mov r4, #48 ; ARM-linux-NEXT: mov r5, #0 @@ -185,7 +185,7 @@ ; ARM-android-NEXT: mov r5, sp ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB3_2 +; ARM-android-NEXT: bls .LBB3_2 ; ARM-android: mov r4, #48 ; ARM-android-NEXT: mov r5, #0 @@ -212,7 +212,7 @@ ; ARM-linux-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-linux-NEXT: ldr r4, [r4, #4] ; ARM-linux-NEXT: cmp r4, r5 -; ARM-linux-NEXT: blo .LBB4_2 +; ARM-linux-NEXT: bls .LBB4_2 ; ARM-linux: ldr r4, .LCPI4_0 ; ARM-linux-NEXT: mov r5, #0 @@ -235,7 +235,7 @@ ; ARM-android-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-android-NEXT: ldr r4, [r4, #252] ; ARM-android-NEXT: cmp r4, r5 -; ARM-android-NEXT: blo .LBB4_2 +; ARM-android-NEXT: bls .LBB4_2 ; ARM-android: ldr r4, .LCPI4_0 ; ARM-android-NEXT: mov r5, #0 diff --git a/llvm/test/CodeGen/Thumb/segmented-stacks-dynamic.ll b/llvm/test/CodeGen/Thumb/segmented-stacks-dynamic.ll --- a/llvm/test/CodeGen/Thumb/segmented-stacks-dynamic.ll +++ b/llvm/test/CodeGen/Thumb/segmented-stacks-dynamic.ll @@ -27,7 +27,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI0_0 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB0_2 +; Thumb-linux-NEXT: bls .LBB0_2 ; Thumb-linux: mov r4, #16 ; Thumb-linux-NEXT: mov r5, #0 @@ -47,7 +47,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI0_0 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB0_2 +; Thumb-android-NEXT: bls .LBB0_2 ; Thumb-android: mov r4, #16 ; Thumb-android-NEXT: mov r5, #0 diff --git a/llvm/test/CodeGen/Thumb/segmented-stacks.ll b/llvm/test/CodeGen/Thumb/segmented-stacks.ll --- a/llvm/test/CodeGen/Thumb/segmented-stacks.ll +++ b/llvm/test/CodeGen/Thumb/segmented-stacks.ll @@ -19,7 +19,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI0_0 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB0_2 +; Thumb-android-NEXT: bls .LBB0_2 ; Thumb-android: mov r4, #48 ; Thumb-android-NEXT: mov r5, #0 @@ -43,7 +43,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI0_0 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB0_2 +; Thumb-linux-NEXT: bls .LBB0_2 ; Thumb-linux: mov r4, #48 ; Thumb-linux-NEXT: mov r5, #0 @@ -72,7 +72,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI1_0 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB1_2 +; Thumb-android-NEXT: bls .LBB1_2 ; Thumb-android: mov r4, #56 ; Thumb-android-NEXT: mov r5, #0 @@ -92,7 +92,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI1_0 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB1_2 +; Thumb-linux-NEXT: bls .LBB1_2 ; Thumb-linux: mov r4, #56 ; Thumb-linux-NEXT: mov r5, #0 @@ -121,7 +121,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI2_3 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB2_2 +; Thumb-android-NEXT: bls .LBB2_2 ; Thumb-android: ldr r4, .LCPI2_2 ; Thumb-android-NEXT: mov r5, #0 @@ -146,7 +146,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI2_3 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB2_2 +; Thumb-linux-NEXT: bls .LBB2_2 ; Thumb-linux: ldr r4, .LCPI2_2 ; Thumb-linux-NEXT: mov r5, #0 @@ -173,7 +173,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI3_0 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB3_2 +; Thumb-android-NEXT: bls .LBB3_2 ; Thumb-android: mov r4, #48 ; Thumb-android-NEXT: mov r5, #0 @@ -193,7 +193,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI3_0 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB3_2 +; Thumb-linux-NEXT: bls .LBB3_2 ; Thumb-linux: mov r4, #48 ; Thumb-linux-NEXT: mov r5, #0 @@ -222,7 +222,7 @@ ; Thumb-android-NEXT: ldr r4, .LCPI4_3 ; Thumb-android-NEXT: ldr r4, [r4] ; Thumb-android-NEXT: cmp r4, r5 -; Thumb-android-NEXT: blo .LBB4_2 +; Thumb-android-NEXT: bls .LBB4_2 ; Thumb-android: ldr r4, .LCPI4_2 ; Thumb-android-NEXT: mov r5, #0 @@ -247,7 +247,7 @@ ; Thumb-linux-NEXT: ldr r4, .LCPI4_3 ; Thumb-linux-NEXT: ldr r4, [r4] ; Thumb-linux-NEXT: cmp r4, r5 -; Thumb-linux-NEXT: blo .LBB4_2 +; Thumb-linux-NEXT: bls .LBB4_2 ; Thumb-linux: ldr r4, .LCPI4_2 ; Thumb-linux-NEXT: mov r5, #0 diff --git a/llvm/test/CodeGen/Thumb2/segmented-stacks.ll b/llvm/test/CodeGen/Thumb2/segmented-stacks.ll --- a/llvm/test/CodeGen/Thumb2/segmented-stacks.ll +++ b/llvm/test/CodeGen/Thumb2/segmented-stacks.ll @@ -14,7 +14,7 @@ ; THUMB-NEXT: mov r5, sp ; THUMB-NEXT: ldr.w r4, [r4, #252] ; THUMB-NEXT: cmp r4, r5 -; THUMB-NEXT: blo .LBB0_2 +; THUMB-NEXT: bls .LBB0_2 ; THUMB-NEXT: @ %bb.1: ; THUMB-NEXT: mov r4, #48 ; THUMB-NEXT: mov r5, #0 @@ -42,7 +42,7 @@ ; ARM-NEXT: mov r5, sp ; ARM-NEXT: ldr r4, [r4, #252] ; ARM-NEXT: cmp r4, r5 -; ARM-NEXT: blo .LBB0_2 +; ARM-NEXT: bls .LBB0_2 ; ARM-NEXT: @ %bb.1: ; ARM-NEXT: mov r4, #48 ; ARM-NEXT: mov r5, #0 @@ -82,7 +82,7 @@ ; THUMB-NEXT: mrc p15, #0, r4, c13, c0, #3 ; THUMB-NEXT: ldr.w r4, [r4, #252] ; THUMB-NEXT: cmp r4, r5 -; THUMB-NEXT: blo .LBB1_2 +; THUMB-NEXT: bls .LBB1_2 ; THUMB: movw r4, #40192 ; THUMB-NEXT: movt r4, #0 @@ -104,7 +104,7 @@ ; ARM-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-NEXT: ldr r4, [r4, #252] ; ARM-NEXT: cmp r4, r5 -; ARM-NEXT: blo .LBB1_2 +; ARM-NEXT: bls .LBB1_2 ; ARM: ldr r4, .LCPI1_0 ; ARM-NEXT: mov r5, #0 @@ -136,7 +136,7 @@ ; THUMB-NEXT: mrc p15, #0, r4, c13, c0, #3 ; THUMB-NEXT: ldr.w r4, [r4, #252] ; THUMB-NEXT: cmp r4, r5 -; THUMB-NEXT: blo .LBB2_2 +; THUMB-NEXT: bls .LBB2_2 ; THUMB: movw r4, #40192 ; THUMB-NEXT: movt r4, #0 @@ -157,7 +157,7 @@ ; ARM-NEXT: mrc p15, #0, r4, c13, c0, #3 ; ARM-NEXT: ldr r4, [r4, #252] ; ARM-NEXT: cmp r4, r5 -; ARM-NEXT: blo .LBB2_2 +; ARM-NEXT: bls .LBB2_2 ; ARM: ldr r4, .LCPI2_0 ; ARM-NEXT: mov r5, #0