[PATCH] D148594: [X86] Transform `(cmp eq/ne trunc(X), C)` -> `(cmp eq/ne X, Zext(C))`

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 02:42:18 PDT 2023


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM - we might want to consider a DAGISel peephole to take of cases where we lose signextended imm8 values.



================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54454
         const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+        ConstantSDNode *C = cast<ConstantSDNode>(RHS);
         if (DAG.MaskedValueIsZero(LHS.getOperand(0), UpperBits) &&
----------------
auto *


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148594



More information about the llvm-commits mailing list