[PATCH] D34048: [PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 13:41:16 PDT 2017


echristo added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:2890
+  bool IsRHSOne = RHSValue == 1;
+  bool IsRHSNegOne = RHSValue == -1LL;
   switch (CC) {
----------------
nemanjai wrote:
> `IsRHSOne/IsRHSNegOne` are not currently used but will be used to produce the `LHS <= 0` sequence for `LHS < 1` and the `LHS >= 0` sequence for `LHS > -1` in a subsequent patch.
> 
> Rather than omitting them from this patch and the function that re-sets them, I left them in. This way if this isn't how we want to implement `swapAndReset()`, I can address it in this patch rather than having to re-work it in the next.
I don't like committing dead code so let's try to avoid that.

The swapAndReset function is a little unusual. I'd probably just suggest grabbing the values you need as you need them rather than breaking it out into a function. Depending on how it looks I'd just comment the swap and fall through.

Thoughts?




Repository:
  rL LLVM

https://reviews.llvm.org/D34048





More information about the llvm-commits mailing list