[PATCH] D146512: [TLI] SimplifySetCC - Fold ~X >/< ~Y --> Y >/< X

Jun Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 01:54:56 PDT 2023


junaire added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:4985
+  if ((isSignedIntSetCC(Cond) || isUnsignedIntSetCC(Cond)) &&
+      N0.getValueType().isInteger()) {
+    if (isBitwiseNot(N0)) {
----------------
RKSimon wrote:
> N0.getValueType().isInteger() should be implied from the CodeCode - I don't think you need it but make it an assert if you're worried
Looks like it's a must, without the check I saw lots of crashes in the tests. For example:
```
llc: llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:4985: llvm::SDValue llvm::TargetLowering::SimplifySetCC(llvm::EVT, llvm::SDValue, llvm::SDValue, ISD::CondCode, bool, llvm::TargetLowering::DAGCombinerInfo &, const llvm::SDLoc &) const: Assertion `N0.getValueType().isInteger() && "N0 is not an ineger type"' failed.
... Crashes ....
llvm-project/llvm/test/CodeGen/X86/machine-combiner.ll:694:14: error: SSE-LABEL: expected string not found in input
...
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146512



More information about the llvm-commits mailing list