diff libinterp/interp-core/jit-typeinfo.h @ 15370:8355fddce815

Use sret and do not use save/restore stack (bug #37308) * jit-typeinfo.cc (octave_jit_grab_matrix, octave_jit_cast_matrix_any, octave_jit_paren_subsasgn_impl, octave_jit_paren_scalar_subsasgn, octave_jit_paren_subsasgn_matrix_range): Return matrix directly. (octave_jit_cast_range_any): Return range directly. (jit_function::jit_function): Maybe mark llvm function return as sret. (jit_function::call): Maybe mark llvm call sret and place allocas at function entry. (jit_function::do_return): Handle new parameter, verify. (jit_typeinfo::jit_typeinfo): Match C++ std::complex type better, pass jit_convetion::external explicitly, and disable right complex division. (jit_typeinfo::create_identity): Improve name. (jit_typeinfo::pack_complex, jit_typeinfo::unpack_complex): Handle changed complex format. * jit-typeinfo.h (jit_array::jit_array): New overload. (jit_type::mark_sret, jit_type::mark_pointer_arg): Remove default convention. (jit_function::do_return): Add verify parameter. * pt-jit.cc (jit_convert_llvm::convert_function): Store the jit_function. (jit_convert::visit): Call do_return if converting a function. * pt-jit.h (jit_convert_llvm::creating): New member variable.
author Max Brister <max@2bass.com>
date Wed, 12 Sep 2012 19:18:51 -0600
parents 3f43e9d6d86e
children 8ccb187b24e9
line wrap: on
line diff
--- a/libinterp/interp-core/jit-typeinfo.h	Wed Sep 12 20:06:05 2012 -0700
+++ b/libinterp/interp-core/jit-typeinfo.h	Wed Sep 12 19:18:51 2012 -0600
@@ -66,6 +66,8 @@
 struct
 jit_array
 {
+  jit_array () : array (0) {}
+
   jit_array (T& from) : array (new T (from))
   {
     update ();
@@ -161,7 +163,7 @@
   // retval. (on the stack)
   bool sret (jit_convention::type cc) const { return msret[cc]; }
 
-  void mark_sret (jit_convention::type cc = jit_convention::external)
+  void mark_sret (jit_convention::type cc)
   { msret[cc] = true; }
 
   // A function like: void foo (mytype arg0)
@@ -169,7 +171,7 @@
   // Basically just pass by reference.
   bool pointer_arg (jit_convention::type cc) const { return mpointer_arg[cc]; }
 
-  void mark_pointer_arg (jit_convention::type cc = jit_convention::external)
+  void mark_pointer_arg (jit_convention::type cc)
   { mpointer_arg[cc] = true; }
 
   // Convert into an equivalent form before calling. For example, complex is
@@ -278,7 +280,8 @@
 
   llvm::Value *argument (llvm::IRBuilderD& builder, size_t idx) const;
 
-  void do_return (llvm::IRBuilderD& builder, llvm::Value *rval = 0);
+  void do_return (llvm::IRBuilderD& builder, llvm::Value *rval = 0,
+                  bool verify = true);
 
   llvm::Function *to_llvm (void) const { return llvm_function; }