[cfe-dev] Correspondence between IR and AST branch ways

이광무 via cfe-dev cfe-dev at lists.llvm.org
Sun Sep 8 21:00:06 PDT 2019


Hi all,

I’m currently writing an IR pass that’s required to match a ‘br’ instruction (in IR) with a specific AST if statement. Matching itself can be done quite easily through DebugLoc, but I realized that the ‘way’ (as in where the control flow continues after it’s been (not-)taken) of a branch can be changed in the course of IR optimizations. For example, a branch ‘if (x == 0)’ can be semantically transformed to ‘if (x != 0)’ in the resulting IR.

My question is, how can I know such way-changing transformation has been done on which branches? Or, is there any way I can prevent such way-changes during optimization?

Thanks,
Gwangmu Lee.

Gwangmu Lee
Ph.D. Student
+82) 10 4114 7441
Room 615, Bldg 301, Seoul National University,
Gwanak-ro 1, Gwanak-gu, Seoul, South Korea.
http://compsec.snu.ac.kr/~gwangmu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190909/f5a951e9/attachment.html>


More information about the cfe-dev mailing list