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

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 14:06:18 PDT 2017


nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:2890
+  bool IsRHSOne = RHSValue == 1;
+  bool IsRHSNegOne = RHSValue == -1LL;
   switch (CC) {
----------------
echristo wrote:
> 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?
> 
> 
Actually, I think that makes sense. At every place where we'd call that function, we just need to swap and set one of the three Boolean variables. I'll get rid of the function and put the code in the caller.


Repository:
  rL LLVM

https://reviews.llvm.org/D34048





More information about the llvm-commits mailing list