[PATCH] D21774: [X86] Transform setcc + movzbl into xorl + setcc
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 09:26:05 PDT 2016
mkuper added a comment.
Thanks, Hans.
================
Comment at: lib/Target/X86/X86FixupSetCC.cpp:84
@@ +83,3 @@
+
+ for (auto &MBB : MF)
+ for (auto &MI : MBB) {
----------------
hans wrote:
> nit: I'd use braces here to help the reader
Ack.
================
Comment at: lib/Target/X86/X86FixupSetCC.cpp:115
@@ +114,3 @@
+ if (!ZExt)
+ break;
+
----------------
hans wrote:
> 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'
> ```
You're right, it'll look nicer.
http://reviews.llvm.org/D21774
More information about the llvm-commits
mailing list