[PATCH] D34769: [X86] X86::CMOV to Branch heuristic based optimization

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 13:09:33 PDT 2017


zvi accepted this revision.
zvi added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks, Amjad!



================
Comment at: lib/Target/X86/X86CmovConversion.cpp:564
+  // destination registers, and the registers that went into the PHI.
+  DenseMap<unsigned, std::pair<unsigned, unsigned>> RegRewriteTable;
+
----------------
aaboud wrote:
> zvi wrote:
> > Please add comment explaining the data-structure
> There is a comment explaining this map and even explaining the motivation behind it:
> 
> ```
>   //  ...   and that the code must maintain a mapping from earlier PHI's
>   // destination registers, and the registers that went into the PHI.
> ```
That comment explaining why we need to maintain the mapping is great. I thought it would be helpful to add something like:

  // Maps Phi's Def VirtReg -> (Incoming0, Incoming1)

I'm fine with keeping it as-is.



https://reviews.llvm.org/D34769





More information about the llvm-commits mailing list