[PATCH] D105220: [ScalarizeMaskedMemIntrin] Use the element type to calculate alignment for gather/scatter when alignment operand is 0.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 17:07:45 PDT 2021
craig.topper added a comment.
In D105220#2851174 <https://reviews.llvm.org/D105220#2851174>, @efriedma wrote:
> Instead of messing with this, can we just change the verifier to require that the alignment argument to masked_gather is nonzero? (And teach autoupgrade to fix old code.) This is just a lesser version of the same mess we used to have with other load/store operations.
>
> If you're going to fix it this way, though, please also fix SelectionDAGBuilder.
I stared at the autoupgrade code for intrinsics. I can't find any cases of autoupgrading an intrinsic by changing the value of an argument. It looks like the interface with the LLParser and BitcodeReader don't quite work for this. I think we need to return true with NewFn = nullptr from UpgradeIntrinsicFunction. That will enable UpgradeCallsToIntrinsic to call UpgradeIntrinsicCall which will enable LLParser. BitCodeReader calls UpgradeIntrinsicCall directly. Then in UpgradeIntrinsicCall we would need to modify the argument and generate a new call with the correct arguments. But I think UpgradeCallsToIntrinsic or the BitCodeReader will then try to delete the intrinsic declaration after all calls are upgraded because they don't expect AutoUpgrade to replace a call with a call to the same intrinsic. They think the declaration should be dead after upgrading all the calls.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105220/new/
https://reviews.llvm.org/D105220
More information about the llvm-commits
mailing list