@paxteam in GCC plugin, do you know how to identify in the code if the condition in the gimple pass is coming from a loop statement (for/while) or from a real condition ("if") statement ? couldn't find examples how to work with PLUGIN_START_PARSE_FUNCTION pass ...
1
Replying to @LolyRoP
never used START_PARSE_FUNCTION so no idea about that, but gcc produces lots of loop related metadata, start with loop_optimizer_init to explore what you can do with them. loop->header/latch may be useful for your case?

Jan 30, 2021 · 8:35 AM UTC

1
Replying to @paxteam
yes it does now i need to figure out the scope of the branch or the while since in the start of parsing i can see clearly the scope of the "if" and "else" and "while" but harder to see in the gimple stages