[PATCH] D109214: [DAG] Fold setcc eq with ashr to compare to zero.

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 03:51:17 PDT 2021


uabelho added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3921
+                          DAG.getConstant(0, dl, OpVT),
+                          Cond == ISD::SETEQ ? ISD::SETLT : ISD::SETGT);
+    }
----------------
The comment at line 3914 says we should use "setge" for the "setne" case, but the code actually use "SETGT"?

I'm seeing a miscompile with this patch for my out of tree target and I'm not sure what the problem actually is, but the difference between the comment and the code caught my eye.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109214/new/

https://reviews.llvm.org/D109214



More information about the llvm-commits mailing list