Working AHRS Arduino code has been posted for the LSM9DS1 breakout, based on the Mahony fusion filter. I also posted code for a tilt-compensated compass and detailed instructions and code for accurately calibrating the accelerometer and magnetometer.
The AHRS code requires the Sparkfun LSM9DS1 library. With default sample rate settings, the update rate is 80Hz on a 16 MHz Arduino Pro Mini, and the code takes up less than half the flash memory.
The LSM9DS1 sensor performs far better than the obsolete MPU-9250 and also better than any other consumer grade IMU I have tested.
The Adafruit LSM9DS1 breakout was used for the development as it has on board level shifters for 3V and 5V processors, but the code will be fine with the Sparkfun breakout and a 3.3V processor.
Note: The X, Y and Z accel/gyro axes DO NOT form a right handed system, contrary to the Sparkfun breakout board product description. This is corrected in the code.