On 09/10/2012 09:11 AM, Iyer, Balaji V wrote: > Can you please help me get a start on how to get can be done? From > what I understand (please correct me if I am wrong), this requires > rearranging and duplicating a lot of passes and can potentially open > up to a lot of bugs.
Certainly not duplicating passes. And probably not even rearranging them. The Important parts are: (1) Having a bit in "struct loop" that indicates the special semantics you have for #pragma simd. I don't know if maybe all loops inside an elemental function are so automatically marked? (2) Have bits in "struct function" that summarize the contents of the bit from "struct loop", for all loops in the function. Note that this bit would need to be updated during inlining. (3) Change the "gate" predicates for the relevant function to also check the bit from "struct function". In some cases the pass might need to run globally (perhaps if-conversion?) and in some cases the pass might be able to restrict work to specific loops (e.g. the vectorizer), skipping loops for which the optimization is not enabled. r~