[llvm] [GISel] Convert zext nneg to sext if it is cheaper (PR #93856)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 11:24:28 PDT 2024


================
@@ -7400,3 +7400,23 @@ bool CombinerHelper::matchZextOfTrunc(const MachineOperand &MO,
 
   return false;
 }
+
+bool CombinerHelper::matchNonNegZext(const MachineOperand &MO,
+                                     BuildFnTy &MatchInfo) {
+  GZext *Zext = cast<GZext>(getDefIgnoringCopies(MO.getReg(), MRI));
----------------
arsenm wrote:

Can this just to get def? It shouldn't have to worry about intervening copies (I think we have too many uses of getDefIgnoringCopies) 

https://github.com/llvm/llvm-project/pull/93856


More information about the llvm-commits mailing list