[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86TargetAsmInfo.cpp

Reid Spencer reid at x10sys.com
Sat Dec 30 21:56:08 PST 2006



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.307 -> 1.308
X86TargetAsmInfo.cpp updated: 1.13 -> 1.14
---
Log message:

For PR950: http://llvm.org/PR950 :
Three changes:
1. Convert signed integer types to signless versions.
2. Implement the @sext and @zext parameter attributes. Previously the
   type of an function parameter was used to determine whether it should
   be sign extended or zero extended before the call. This information is
   now communicated via the function type's parameter attributes. 
3. The interface to LowerCallTo had to be changed in order to accommodate
   the parameter attribute information. Although it would have been
   convenient to pass in the FunctionType itself, there isn't always one
   present in the caller. Consequently, a signedness indication for the
   result type and for each parameter was provided for in the interface
   to this method. All implementations were changed to make the adjustment
   necessary.


---
Diffs of the changes:  (+25 -17)

 X86ISelLowering.cpp  |   32 ++++++++++++++++++++------------
 X86TargetAsmInfo.cpp |   10 +++++-----
 2 files changed, 25 insertions(+), 17 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.307 llvm/lib/Target/X86/X86ISelLowering.cpp:1.308
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.307	Fri Dec 22 16:29:05 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Sat Dec 30 23:55:36 2006
@@ -4447,14 +4447,21 @@
       (I && I->getValue() < Subtarget->getMinRepStrSizeThreshold())) {
     MVT::ValueType IntPtr = getPointerTy();
     const Type *IntPtrTy = getTargetData()->getIntPtrType();
-    std::vector<std::pair<SDOperand, const Type*> > Args;
-    Args.push_back(std::make_pair(Op.getOperand(1), IntPtrTy));
+    TargetLowering::ArgListTy Args; 
+    TargetLowering::ArgListEntry Entry;
+    Entry.Node = Op.getOperand(1);
+    Entry.Ty = IntPtrTy;
+    Entry.isSigned = false;
+    Args.push_back(Entry);
     // Extend the ubyte argument to be an int value for the call.
-    SDOperand Val = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Op.getOperand(2));
-    Args.push_back(std::make_pair(Val, IntPtrTy));
-    Args.push_back(std::make_pair(Op.getOperand(3), IntPtrTy));
+    Entry.Node = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Op.getOperand(2));
+    Entry.Ty = IntPtrTy;
+    Entry.isSigned = false;
+    Args.push_back(Entry);
+    Entry.Node = Op.getOperand(3);
+    Args.push_back(Entry);
     std::pair<SDOperand,SDOperand> CallResult =
-      LowerCallTo(Chain, Type::VoidTy, false, CallingConv::C, false,
+      LowerCallTo(Chain, Type::VoidTy, false, false, CallingConv::C, false,
                   DAG.getExternalSymbol("memset", IntPtr), Args, DAG);
     return CallResult.second;
   }
@@ -4601,13 +4608,14 @@
   if ((Align & 3) != 0 ||
       (I && I->getValue() < Subtarget->getMinRepStrSizeThreshold())) {
     MVT::ValueType IntPtr = getPointerTy();
-    const Type *IntPtrTy = getTargetData()->getIntPtrType();
-    std::vector<std::pair<SDOperand, const Type*> > Args;
-    Args.push_back(std::make_pair(Op.getOperand(1), IntPtrTy));
-    Args.push_back(std::make_pair(Op.getOperand(2), IntPtrTy));
-    Args.push_back(std::make_pair(Op.getOperand(3), IntPtrTy));
+    TargetLowering::ArgListTy Args;
+    TargetLowering::ArgListEntry Entry;
+    Entry.Ty = getTargetData()->getIntPtrType(); Entry.isSigned = false;
+    Entry.Node = Op.getOperand(1); Args.push_back(Entry);
+    Entry.Node = Op.getOperand(2); Args.push_back(Entry);
+    Entry.Node = Op.getOperand(3); Args.push_back(Entry);
     std::pair<SDOperand,SDOperand> CallResult =
-      LowerCallTo(Chain, Type::VoidTy, false, CallingConv::C, false,
+      LowerCallTo(Chain, Type::VoidTy, false, false, CallingConv::C, false,
                   DAG.getExternalSymbol("memcpy", IntPtr), Args, DAG);
     return CallResult.second;
   }


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.13 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.14
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.13	Tue Dec 19 15:04:20 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp	Sat Dec 30 23:55:36 2006
@@ -172,13 +172,13 @@
       !CI->getType()->isInteger())
     return false;
   
-  const Type *Ty = CI->getType()->getUnsignedVersion();
+  const Type *Ty = CI->getType();
   const char *IntName;
   switch (Ty->getTypeID()) {
   default: return false;
-  case Type::UShortTyID: IntName = "llvm.bswap.i16"; break;
-  case Type::UIntTyID:   IntName = "llvm.bswap.i32"; break;
-  case Type::ULongTyID:  IntName = "llvm.bswap.i64"; break;
+  case Type::Int16TyID: IntName = "llvm.bswap.i16"; break;
+  case Type::Int32TyID:   IntName = "llvm.bswap.i32"; break;
+  case Type::Int64TyID:  IntName = "llvm.bswap.i64"; break;
   }
 
   // Okay, we can do this xform, do so now.
@@ -226,7 +226,7 @@
     }
     break;
   case 3:
-    if (CI->getType() == Type::ULongTy && Constraints.size() >= 2 &&
+    if (CI->getType() == Type::Int64Ty && Constraints.size() >= 2 &&
         Constraints[0].Codes.size() == 1 && Constraints[0].Codes[0] == "A" &&
         Constraints[1].Codes.size() == 1 && Constraints[1].Codes[0] == "0") {
       // bswap %eax / bswap %edx / xchgl %eax, %edx  -> llvm.bswap.i64






More information about the llvm-commits mailing list