Architectural support for irregular programs and performance monitoring for heterogeneous systems