diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 14:08:42 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 14:08:42 +0000 |
| commit | 43d33bd6d265a4f90e0fb5431b76702cc7bcb3f5 (patch) | |
| tree | 7f68ddc06aebb8abda18ff1cb9bb102418347fd4 | |
| parent | a8197bb651acdc77283c494eac3933c6dd0d3230 (diff) | |
| download | bcm5719-llvm-43d33bd6d265a4f90e0fb5431b76702cc7bcb3f5.tar.gz bcm5719-llvm-43d33bd6d265a4f90e0fb5431b76702cc7bcb3f5.zip | |
Emit proper lowering of load from arg stack slot
llvm-svn: 75986
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 16 | ||||
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/2009-06-05-InvalidArgLoad.ll | 19 |
2 files changed, 25 insertions, 10 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index c1004e12c8e..096fe420cc5 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -186,20 +186,16 @@ SDValue SystemZTargetLowering::LowerCCCArguments(SDValue Op, } else { // Sanity check assert(VA.isMemLoc()); - // Load the argument to a virtual register - unsigned ObjSize = VA.getLocVT().getSizeInBits()/8; - if (ObjSize > 8) { - cerr << "LowerFORMAL_ARGUMENTS Unhandled argument type: " - << VA.getLocVT().getSimpleVT() - << "\n"; - } + + // Create the nodes corresponding to a load from this parameter slot. // Create the frame index object for this incoming parameter... - int FI = MFI->CreateFixedObject(ObjSize, VA.getLocMemOffset()); + int FI = MFI->CreateFixedObject(VA.getValVT().getSizeInBits()/8, + VA.getLocMemOffset()); // Create the SelectionDAG nodes corresponding to a load //from this parameter - SDValue FIN = DAG.getFrameIndex(FI, MVT::i64); - ArgValues.push_back(DAG.getLoad(VA.getLocVT(), dl, Root, FIN, + SDValue FIN = DAG.getFrameIndex(FI, getPointerTy()); + ArgValues.push_back(DAG.getLoad(VA.getValVT(), dl, Root, FIN, PseudoSourceValue::getFixedStack(FI), 0)); } } diff --git a/llvm/test/CodeGen/SystemZ/2009-06-05-InvalidArgLoad.ll b/llvm/test/CodeGen/SystemZ/2009-06-05-InvalidArgLoad.ll new file mode 100644 index 00000000000..79d74bc2667 --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/2009-06-05-InvalidArgLoad.ll @@ -0,0 +1,19 @@ +; RUN: llvm-as < %s | llc + +target datalayout = "E-p:64:64:64-i1:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128" +target triple = "s390x-ibm-linux" + %struct.re_pattern_buffer = type <{ i8*, i64, i64, i64, i8*, i8*, i64, i8, i8, i8, i8, i8, i8, i8, i8 }> + %struct.re_registers = type <{ i32, i8, i8, i8, i8, i32*, i32* }> + +define i32 @xre_search_2(%struct.re_pattern_buffer* nocapture %bufp, i8* %string1, i32 %size1, i8* %string2, i32 %size2, i32 %startpos, i32 %range, %struct.re_registers* %regs, i32 %stop) nounwind { +entry: + %cmp17.i = icmp slt i32 undef, %startpos ; <i1> [#uses=1] + %or.cond.i = or i1 undef, %cmp17.i ; <i1> [#uses=1] + br i1 %or.cond.i, label %byte_re_search_2.exit, label %if.then20.i + +if.then20.i: ; preds = %entry + ret i32 -2 + +byte_re_search_2.exit: ; preds = %entry + ret i32 -1 +} |

