[llvm] r273029 - ARM: take account of possible bundle when erasing an instruction.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 11:40:46 PDT 2016
Author: tnorthover
Date: Fri Jun 17 13:40:46 2016
New Revision: 273029
URL: http://llvm.org/viewvc/llvm-project?rev=273029&view=rev
Log:
ARM: take account of possible bundle when erasing an instruction.
Fortunately this appears to be the only ARM-specific pass that runs while
bundles might be in play, so no other cases need modifying.
Modified:
llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp
llvm/trunk/test/CodeGen/ARM/thumb2-size-opt.ll
Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=273029&r1=273028&r2=273029&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Fri Jun 17 13:40:46 2016
@@ -461,7 +461,7 @@ Thumb2SizeReduce::ReduceLoadStore(Machin
MIB.setMIFlags(MI->getFlags());
// Kill the old instruction.
- MI->eraseFromParent();
+ MI->eraseFromBundle();
++NumLdSts;
return true;
}
Modified: llvm/trunk/test/CodeGen/ARM/thumb2-size-opt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/thumb2-size-opt.ll?rev=273029&r1=273028&r2=273029&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/thumb2-size-opt.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/thumb2-size-opt.ll Fri Jun 17 13:40:46 2016
@@ -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
+}
More information about the llvm-commits
mailing list