[llvm] Update the base and index value for masked gather (PR #130920)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 12 23:12:03 PDT 2025
================
@@ -61619,3 +61624,99 @@ Align X86TargetLowering::getPrefLoopAlignment(MachineLoop *ML) const {
return Align(1ULL << ExperimentalPrefInnermostLoopAlignment);
return TargetLowering::getPrefLoopAlignment();
}
+
+// Target override this function to decided whether it want to update the base
+// and index value of a non-uniform gep
+bool X86TargetLowering::updateBaseAndIndex(const Value *Ptr, SDValue &Base,
+ SDValue &Index, const SDLoc &DL,
+ const SDValue &Gep,
+ SelectionDAG &DAG,
+ const BasicBlock *CurBB) const {
+ if (!EnableBaseIndexUpdate)
+ return false;
+
+ const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr);
+ if (GEP && GEP->getParent() != CurBB)
+ return false;
+
+ SDValue nbase;
+ /* For the gep instruction, we are trying to properly assign the base and
----------------
topperc wrote:
Use `//` comments
https://github.com/llvm/llvm-project/pull/130920
More information about the llvm-commits
mailing list