[PATCH] D40554: [PowerPC] Fix bugs in sign-/zero-extension elimination

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 07:11:13 PST 2022


amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:5092
 
 // This function returns true if the machine instruction
 // always outputs a value by sign-extending a 32 bit value,
----------------
Question: should we update this to say if the `register` and not `machine instruction` since it is changed to `Reg` for the parameter? 
Or should it stay as machine instruction since you're checking for the different `MachineInstr` opcodes in this function?
The same question I have applies to `definedByZeroExtendingOp()`.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:5129
 
+  // RLDICL generates sign-extended output if it cleares at least
+  // 33 bits from the left (MSB).
----------------



================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:5314
+    auto SrcExt = isSignOrZeroExtended(SrcReg, BinOpDepth, MRI);
+    return std::pair<bool, bool>(SrcExt.first | IsSExt, SrcExt.second | IsZExt);
   }
----------------
If the change to logical or still applies, we should probably update these accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D40554



More information about the llvm-commits mailing list