summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/ARM/Thumb2SizeReduction.cpp2
-rw-r--r--llvm/test/CodeGen/ARM/thumb2-size-opt.ll16
2 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp b/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
index e1b126650d8..8df85e990d9 100644
--- a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
+++ b/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
@@ -461,7 +461,7 @@ Thumb2SizeReduce::ReduceLoadStore(MachineBasicBlock &MBB, MachineInstr *MI,
MIB.setMIFlags(MI->getFlags());
// Kill the old instruction.
- MI->eraseFromParent();
+ MI->eraseFromBundle();
++NumLdSts;
return true;
}
diff --git a/llvm/test/CodeGen/ARM/thumb2-size-opt.ll b/llvm/test/CodeGen/ARM/thumb2-size-opt.ll
index 0084a456a72..aba027607ea 100644
--- a/llvm/test/CodeGen/ARM/thumb2-size-opt.ll
+++ b/llvm/test/CodeGen/ARM/thumb2-size-opt.ll
@@ -82,3 +82,19 @@ entry:
%shr = lshr i32 %a, %b
ret i32 %shr
}
+
+define i32 @bundled_instruction(i32* %addr, i32** %addr2, i1 %tst) minsize {
+; CHECK-LABEL: bundled_instruction:
+; CHECK: iteee ne
+; CHECK: ldmeq r0!, {{{r[0-9]+}}}
+ br i1 %tst, label %true, label %false
+
+true:
+ ret i32 0
+
+false:
+ %res = load i32, i32* %addr, align 4
+ %next = getelementptr i32, i32* %addr, i32 1
+ store i32* %next, i32** %addr2
+ ret i32 %res
+}
OpenPOWER on IntegriCloud