We probably need to move where intrinsics are lowered to copies to
make this useful.
Details
Diff Detail
Event Timeline
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
11233 | Try Intrinsic::getAttributes |
Get alignmnent from intrinsic declaration. This can probably go in generic code, but I'm unclear what the semantics of a call site with a lower alignment is
IR has the same issue and the solution adopted in D65281 is that any attribute on the call site takes priority.
Why not put it in generic code to start with? I don't understand why the concern about conflicting alignment would prevent that. I mean, are you more confident about how to handle conflicting alignments for AMDGPU than you are for all other targets?
I know in this case, even if the call site specified a lower alignment, you're always getting at least 4. For other targets, I don't know if a lower call site alignment would need to be respected. Ultimately we need an assert_align pseudo to track the call site attribute
I'd still be inclined to either follow the precedent of IR, or take the max of the two alignments. But I guess this is OK if you're reluctant to do that.
Try Intrinsic::getAttributes