[llvm-commits] [llvm] r125444 - in /llvm/trunk: lib/Target/Sparc/DelaySlotFiller.cpp test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
Venkatraman Govindaraju
venkatra at cs.wisc.edu
Sat Feb 12 11:02:33 PST 2011
Author: venkatra
Date: Sat Feb 12 13:02:33 2011
New Revision: 125444
URL: http://llvm.org/viewvc/llvm-project?rev=125444&view=rev
Log:
Prevent IMPLICIT_DEF/KILL to become a delay filler instruction in SPARC backend.
Modified:
llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp
llvm/trunk/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
Modified: llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp?rev=125444&r1=125443&r2=125444&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp Sat Feb 12 13:02:33 2011
@@ -182,6 +182,9 @@
SmallSet<unsigned, 32> &RegUses)
{
+ if (candidate->isImplicitDef() || candidate->isKill())
+ return true;
+
if (candidate->getDesc().mayLoad()) {
sawLoad = true;
if (sawStore)
Modified: llvm/trunk/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll?rev=125444&r1=125443&r2=125444&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll Sat Feb 12 13:02:33 2011
@@ -1,4 +1,5 @@
;RUN: llc -march=sparc < %s | FileCheck %s
+;RUN: llc -march=sparc -O0 < %s | FileCheck %s -check-prefix=UNOPT
define i32 @test(i32 %a) nounwind {
@@ -75,3 +76,15 @@
declare i32 @foo(...)
declare i32 @bar(i32)
+
+
+define i32 @test_implicit_def() nounwind {
+entry:
+;UNOPT: test_implicit_def
+;UNOPT: call func
+;UNOPT-NEXT: nop
+ %0 = tail call i32 @func(i32* undef) nounwind
+ ret i32 0
+}
+
+declare i32 @func(i32*)
More information about the llvm-commits
mailing list