[llvm] [GlobalISel] Fold G_ICMP if possible (PR #86357)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 07:45:11 PDT 2024


================
@@ -174,6 +174,20 @@ MachineInstrBuilder CSEMIRBuilder::buildInstr(unsigned Opc,
   switch (Opc) {
   default:
     break;
+  case TargetOpcode::G_ICMP: {
+    assert(SrcOps.size() == 3 && "Invalid sources");
+    assert(DstOps.size() == 1 && "Invalid dsts");
+    LLT SrcTy = SrcOps[1].getLLTTy(*getMRI());
+
+    if (std::optional<SmallVector<APInt>> Cst =
----------------
arsenm wrote:

We could add a non-APInt version of buildBuildVectorConstant 

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


More information about the llvm-commits mailing list