diff --git a/pystencils/cpu/vectorization.py b/pystencils/cpu/vectorization.py
index 3fe98fadf3e0ebcd25a76a6e5fbe7923dcf2d365..3b724124a2d39b299f97c294b5bfd570e8110fac 100644
--- a/pystencils/cpu/vectorization.py
+++ b/pystencils/cpu/vectorization.py
@@ -75,7 +75,8 @@ class CachelineSize(ast.Node):
 
 def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
               assume_aligned: bool = False, nontemporal: Union[bool, Container[Union[str, Field]]] = False,
-              assume_inner_stride_one: bool = False, assume_sufficient_line_padding: bool = True):
+              assume_inner_stride_one: bool = False, assume_sufficient_line_padding: bool = True,
+              replace_loops_with_length_one: bool = True):
     # TODO Vectorization Revamp we first introduce the remainder loop and then check if we can even vectorise.
     #  Maybe first copy the ast and return the copied version on failure
     """Explicit vectorization using SIMD vectorization via intrinsics.
@@ -99,6 +100,10 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
                                         assumes that at the end of each line there is enough padding with dummy data
                                         depending on the access pattern there might be additional padding
                                         required at the end of the array
+        replace_loops_with_length_one: If True, the loop cutting inside the vectorizer replaces all lops of length one
+                                       with their inner block and automatically replaces the loop counter variables in
+                                       that block. This should usually be True, however, if custom code nodes depend on
+                                       loop counter variables, you may not want to remove them.
     """
     if instruction_set == 'best':
         if get_supported_instruction_sets():
@@ -133,12 +138,12 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
     keep_loop_stop = '{loop_stop}' in vector_is['storeA' if assume_aligned and 'storeA' in vector_is else 'storeU']
     vectorize_inner_loops_and_adapt_load_stores(kernel_ast, assume_aligned, nontemporal,
                                                 strided, keep_loop_stop, assume_sufficient_line_padding,
-                                                default_float_type)
+                                                default_float_type, replace_loops_with_length_one=replace_loops_with_length_one)
 
 
 def vectorize_inner_loops_and_adapt_load_stores(ast_node, assume_aligned, nontemporal_fields,
                                                 strided, keep_loop_stop, assume_sufficient_line_padding,
-                                                default_float_type):
+                                                default_float_type, replace_loops_with_length_one=True):
     """Goes over all innermost loops, changes increment to vector width and replaces field accesses by vector type."""
     all_loops = list(filtered_tree_iteration(ast_node, ast.LoopOverCoordinate, stop_types=[ast.SympyAssignment, ast.ArrayDeclaration]))
     inner_loops = [loop for loop in all_loops if loop.is_innermost_loop]
@@ -162,7 +167,7 @@ def vectorize_inner_loops_and_adapt_load_stores(ast_node, assume_aligned, nontem
         else:
             cutting_point = modulo_floor(loop_range, vector_width) + loop_node.start
             # TODO cut_loop calls deepcopy on the loop_node. This is bad as documented in cut_loop
-            loop_nodes = [loop for loop in cut_loop(loop_node, [cutting_point]).args
+            loop_nodes = [loop for loop in cut_loop(loop_node, [cutting_point], replace_loops_with_length_one=False).args
                           if isinstance(loop, ast.LoopOverCoordinate)]
             assert len(loop_nodes) in (0, 1, 2)  # 2 for main and tail loop, 1 if loop range divisible by vector width
             if len(loop_nodes) == 0:
diff --git a/pystencils/transformations.py b/pystencils/transformations.py
index 2eb9c902e091729fcc50a23fa7fe3bd3986ff9c2..2d8210a1bf59523c727b18fadc8b8b7a4c96ddad 100644
--- a/pystencils/transformations.py
+++ b/pystencils/transformations.py
@@ -883,7 +883,7 @@ def split_inner_loop(ast_node: ast.Node, symbol_groups):
         outer_loop.parent.append(free_node)
 
 
-def cut_loop(loop_node, cutting_points, with_conditional: bool = False):
+def cut_loop(loop_node, cutting_points, with_conditional: bool = False, replace_loops_with_length_one: bool = True):
     """Cuts loop at given cutting points.
 
     One loop is transformed into len(cuttingPoints)+1 new loops that range from
@@ -901,7 +901,7 @@ def cut_loop(loop_node, cutting_points, with_conditional: bool = False):
     new_start = loop_node.start
     cutting_points = list(cutting_points) + [loop_node.stop]
     for new_end in cutting_points:
-        if new_end - new_start == 1:
+        if replace_loops_with_length_one and (new_end - new_start == 1):
             new_body = deepcopy(loop_node.body)
             new_body.subs({loop_node.loop_counter_symbol: new_start})
             if with_conditional: