[PATCH] D21774: [X86] Transform setcc + movzbl into xorl + setcc

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 09:21:52 PDT 2016


hans added a subscriber: hans.
hans added a comment.

Thanks for working on this!


================
Comment at: lib/Target/X86/X86FixupSetCC.cpp:84
@@ +83,3 @@
+
+  for (auto &MBB : MF)
+    for (auto &MI : MBB) {
----------------
nit: I'd use braces here to help the reader

================
Comment at: lib/Target/X86/X86FixupSetCC.cpp:115
@@ +114,3 @@
+        if (!ZExt)
+          break;
+
----------------
First I thought this was a "break" from the loop, but it's for the switch of course.

Maybe this would be easier to read if the switch part was broken out to an "isSetCC" helper function, then the loop could be



```
  for (auto &MI : MBB) {
    if (!isSetCC(MI))
      continue;

    // do stuff, with no confusion about 'break'
```


http://reviews.llvm.org/D21774





More information about the llvm-commits mailing list