Hardware Accelerated Trace Analysis For Compiler Optimizations