shiltian wrote: I think we are discussing two problems here.
The first one is, where to put the logic. Regarding the hook in TTI, I don't see it as something like `TTI->getIntrinsicAlignment(Intrinsic *I)`. Instead, the logic here is, if a load instruction is to load from AS7 which has alignment Y, the pointer happens to be a `llvm.amdgcn.make.buffer.rsrc`, and the pointer operand of the intrinsic has alignment X, then the alignment of the load instruction would be `min(X,Y)`. I'm not sure how we want to express this logic in a TTI hook, because it is not about the alignment of the intrinsic, unless the hook would be something like `TTI->getInstrunctionAlignment(Instruction *I)`, and the same logic would appear there. Second, do we really need this in the attributor? Can the pointer operand of a load from AS7 be something not from the intrinsic such that we will need an iterative inference? I did ask this question in a separate PR, and IIUC, we don't really support things like GEP at this moment. Are we gonna support it in the future? Sure, but even with that, do we need iterative inference? I'm not sure. Attributor framework is extremely expensive but it doesn't seem like this really benefits from it. I think we can just run the attributor like normal, and then just query the alignment of the pointer operand of the intrinsic, do the math, update the alignment of the instruction, that's all. We really don't need to create a node on the attributor graph and nobody else would use its intermediate value at all. https://github.com/llvm/llvm-project/pull/166914 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
