[PATCH] D118118: [SDAG] Preserve unpredictable metadata, teach X86CmovConversion to respect this metadata

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 07:20:31 PDT 2023


xbolva00 added inline comments.


================
Comment at: llvm/lib/Target/X86/X86CmovConversion.cpp:312
+      if (I.getFlag(MachineInstr::MIFlag::Unpredictable))
+        continue;
+  
----------------
nikic wrote:
> Is it safe to just skip it entirely, or do we need to treat it as a non-cmov instruction?
Good point,  I am not sure, probably we should threat it that way.

@RKSimon / @craig.topper any suggestions?


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:26486
   SDValue Ops[] = { Op2, Op1, CC, Cond };
   return DAG.getNode(X86ISD::CMOV, DL, Op.getValueType(), Ops);
 }
----------------
nikic wrote:
> Is it possible to directly pass the flags here instead? Seems odd to use FlagInserter for a single instruction.
Right, I will fix it.


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

https://reviews.llvm.org/D118118



More information about the llvm-commits mailing list