[llvm-commits] [llvm] r41316 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Anton Korobeynikov asl at math.spbu.ru
Thu Aug 23 00:21:07 PDT 2007


Author: asl
Date: Thu Aug 23 02:21:06 2007
New Revision: 41316

URL: http://llvm.org/viewvc/llvm-project?rev=41316&view=rev
Log:
Perform correct codegen for eh_dwarf_cfa intrinsic.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=41316&r1=41315&r2=41316&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Aug 23 02:21:06 2007
@@ -2751,11 +2751,19 @@
    case Intrinsic::eh_dwarf_cfa: {
      if (ExceptionHandling) {
        MVT::ValueType VT = getValue(I.getOperand(1)).getValueType();
+       SDOperand CfaArg;
+       if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(TLI.getPointerTy()))
+         CfaArg = DAG.getNode(ISD::TRUNCATE,
+                              TLI.getPointerTy(), getValue(I.getOperand(1)));
+       else
+         CfaArg = DAG.getNode(ISD::SIGN_EXTEND,
+                              TLI.getPointerTy(), getValue(I.getOperand(1)));
+       
        SDOperand Offset = DAG.getNode(ISD::ADD,
                                       TLI.getPointerTy(),
                                       DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET,
-                                                  VT),
-                                      getValue(I.getOperand(1)));
+                                                  TLI.getPointerTy()),
+                                      CfaArg);
        setValue(&I, DAG.getNode(ISD::ADD,
                                 TLI.getPointerTy(),
                                 DAG.getNode(ISD::FRAMEADDR,





More information about the llvm-commits mailing list