[PATCH] D17057: Add support for phi nodes in the LLVM C API test

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 16:42:07 PST 2016


joker.eph added inline comments.

================
Comment at: tools/llvm-c-test/echo.cpp:179
@@ -178,3 +178,3 @@
     // Function argument should always be in the map already.
-    if (LLVMIsAArgument(Src)) {
+    if (LLVMIsAArgument(Src) || LLVMIsAInstruction(Src)) {
       auto i = VMap.find(Src);
----------------
Why this addition? (the comment talk about function argument)

The code path seems funky, it seem that the body should always be executed right now or you hit the error.

================
Comment at: tools/llvm-c-test/echo.cpp:208
@@ +207,3 @@
+        // If we have a hit, it means we already generated the instruction
+        // as a dependancy to somethign else. We need to make sure
+        // it is ordered properly.
----------------
s/somethign/something/

To be sure I understand correctly, in case of a loop you'll generate some instruction (only PHI?) "at the wrong place" and then when you see them again you move them where they should be?



http://reviews.llvm.org/D17057





More information about the llvm-commits mailing list