diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -73,6 +73,7 @@ class FastISel; class FunctionLoweringInfo; class GlobalValue; +class GISelKnownBits; class IntrinsicInst; struct KnownBits; class LLVMContext; @@ -3154,7 +3155,8 @@ /// or one and return them in the KnownZero/KnownOne bitsets. The DemandedElts /// argument allows us to only collect the known bits that are shared by the /// requested vector elements. This is for GISel. - virtual void computeKnownBitsForTargetInstr(Register R, KnownBits &Known, + virtual void computeKnownBitsForTargetInstr(GISelKnownBits &Analysis, + Register R, KnownBits &Known, const APInt &DemandedElts, const MachineRegisterInfo &MRI, unsigned Depth = 0) const; diff --git a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp --- a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp +++ b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp @@ -119,7 +119,8 @@ switch (Opcode) { default: - TL.computeKnownBitsForTargetInstr(R, Known, DemandedElts, MRI, Depth); + TL.computeKnownBitsForTargetInstr(*this, R, Known, DemandedElts, MRI, + Depth); break; case TargetOpcode::COPY: { MachineOperand Dst = MI.getOperand(0); diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2570,8 +2570,9 @@ } void TargetLowering::computeKnownBitsForTargetInstr( - Register R, KnownBits &Known, const APInt &DemandedElts, - const MachineRegisterInfo &MRI, unsigned Depth) const { + GISelKnownBits &Analysis, Register R, KnownBits &Known, + const APInt &DemandedElts, const MachineRegisterInfo &MRI, + unsigned Depth) const { Known.resetAll(); }