[PATCH] D87166: [GlobalISel] Add G_UNMERGE(Cst) -> Cst1, Cst2, ... combine

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 14:51:47 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1623-1624
+  MachineInstr *SrcInstr = MRI.getVRegDef(SrcReg);
+  if (SrcInstr->getOpcode() != TargetOpcode::G_CONSTANT)
+    return false;
+  // Break down the big constant in smaller ones.
----------------
Should also handle G_FCONSTANT


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1628
+  unsigned BitWidth = MRI.getType(SrcReg).getSizeInBits();
+  APInt Val = CstVal.isImm() ? APInt(BitWidth, CstVal.getImm())
+                             : CstVal.getCImm()->getValue();
----------------
isImm is illegal


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87166



More information about the llvm-commits mailing list