[PATCH] D31851: [PowerPC] Eliminate compares - add handling for logical operations without the use of condition registers
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 23 10:01:55 PDT 2017
nemanjai added inline comments.
================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:280
enum SetccInGPROpts { ZExtOrig, ZExtInvert, SExtOrig, SExtInvert };
+ enum LogicalOpsInGPR { KeepInGPR, ExtractToCR };
----------------
echristo wrote:
> Part of asking for the enum is wondering why it's necessary. It seems odd to say "getLogicOpInGPR" to want to know whether or not to put something in a GPR.
That's a good point. Perhaps the naming is a poor choice. I could rename it to `performLogicOpInGPR()`.
The idea would be to convey the fact that this simply defers moving the data out of a GPR. What it does is take something like:
`(and (i1 (setcc %a, %b, CC), (setcc %c, %d, CC2)))` and convert it to a sequence that does the comparisons and the logical operation in a GPR.
That of course still leaves the question of whether we want the result of the logical operation itself to stay in a GPR (for further extended operations) or to be moved out to a CR (for use in branches, ISEL, etc.).
So I think maybe renaming the function and/or providing a clearer comment as to what's happening might be the right choice here. What do you think?
Repository:
rL LLVM
https://reviews.llvm.org/D31851
More information about the llvm-commits
mailing list