unsafe fn gen_merge_internal(
        &mut self,
        name: String,
        arguments: &mut [LLVMTypeRef],
        gep_index: u32,
    ) -> WeldResult<LLVMValueRef> {
        let ret_ty = LLVMVoidTypeInContext(self.context);
        let (function, fn_builder, _) = self.define_function(ret_ty, arguments, name);

        LLVMExtAddAttrsOnFunction(self.context, function, &[LLVMExtAttribute::AlwaysInline]);

        // Load the vector element, apply the binary operator, and then store it back.
        let elem_pointer =
            LLVMBuildStructGEP(fn_builder, LLVMGetParam(function, 0), gep_index, c_str!(""));
        let elem = LLVMBuildLoad(fn_builder, elem_pointer, c_str!(""));
        let result = gen_binop(
            fn_builder,
            self.op,
            elem,
            LLVMGetParam(function, 1),
            &Simd(self.scalar_kind),
        )?;
        LLVMBuildStore(fn_builder, result, elem_pointer);
        LLVMBuildRetVoid(fn_builder);
        LLVMDisposeBuilder(fn_builder);
        Ok(function)
    }
Builds the `Merge` function and returns a reference to the function.

The merge function is similar for the scalar and vector varianthe `gep_index determines
which one is generated.
weld/src/codegen/llvm2/builder/merger.rs