[PATCH] D89100: [GlobalISel] Look through truncs and extends in narrowScalarShift

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 11:54:46 PDT 2020


kschwarz added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4189
+          getConstantVRegValWithLookThrough(Amt, MRI, true, false)) {
+    auto *DefMI = MRI.getVRegDef(VRegAndVal->VReg);
     return narrowScalarShiftByConstant(
----------------
arsenm wrote:
> Why do you need to get DefMI? VRegAndVal should have the value already? (Or is this because it stores an int64_t? I've been thinking we should maybe start returning the ConstantInt or APInt instead)
Yes, the motivation was to stick with the existing API and not having to touch narrowScalarShiftByConstant.
Returning APInt from getConstantVRegValWithLookThrough would make this code simpler, but I don't know if its generally preferable? In any case, that would be a separate change, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89100



More information about the llvm-commits mailing list