[llvm] SystemZ: Fold copy of vector immediate to gr128 (PR #90706)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 04:49:15 PDT 2024


================
@@ -2221,3 +2263,15 @@ areMemAccessesTriviallyDisjoint(const MachineInstr &MIa,
 
   return false;
 }
+
+bool SystemZInstrInfo::getConstValDefinedInReg(const MachineInstr &MI,
+                                               const Register Reg,
+                                               int64_t &ImmVal) const {
+
+  if (MI.getOpcode() == SystemZ::VGBM && Reg == MI.getOperand(0).getReg()) {
+    ImmVal = MI.getOperand(1).getImm();
----------------
uweigand wrote:

This likewise needs to compute the correct immediate from the bitmask.  Note that in general this is a 128-bit value so it won't even fit in ImmVal as soon as one of the top 8 bits in the bitmask is set ...

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


More information about the llvm-commits mailing list