[PATCH] D96174: [SelectionDAG][AArch64] Restrict matchUnaryPredicate to only handle SPLAT_VECTOR for scalable vectors.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 9 12:27:22 PST 2021
craig.topper added a comment.
In D96174#2552182 <https://reviews.llvm.org/D96174#2552182>, @RKSimon wrote:
> In D96174#2548077 <https://reviews.llvm.org/D96174#2548077>, @frasercrmck wrote:
>
>> In D96174#2548071 <https://reviews.llvm.org/D96174#2548071>, @craig.topper wrote:
>>
>>> In D96174#2548065 <https://reviews.llvm.org/D96174#2548065>, @david-arm wrote:
>>>
>>>> Looking in lib/CodeGen/SelectionDAG/TargetLowering.cpp at the places where we call matchUnaryPredicate it looks like "VT.isFixedVector" and "VT.isScalableVector" calls are being used as proxies for BUILD_VECTOR and SPLAT_VECTOR. I suspect that checking for BUILD_VECTOR and SPLAT_VECTOR instead would give the right behaviour? Not suggesting that has to be fixed in this patch though...
>>>
>>> Yeah that would work, but it feels a little like leaking implementation details of matchUnaryPredicate into the caller.
>>
>> Agreed. I think it's better than checking the vector type, though. Maybe matchUnaryPredicate could return something to indicate the "root" it matched against?
>
> Have you got a use case where you actually need to know this?
Depends on what behavior we want for this interface and code like in BuildUDIV/BuildSDIV. Here are some options
1. SPLAT_VECTOR on fixed vectors causes matchUnaryPredicate to visit the splat value NumElements times. BuildUDIV/BuildSDIV pushes to vectors num elements times and calls getBuildVector. DAGCombine will probably create SPLAT_VECTOR from those build_vectors.
2. SPLAT_VECTOR on fixed vectors causes matchUnaryPredicate to visit the splat value 1 time. BuildUDIV/BuildSDDIV push to the vectors 1 times and call getSplatBuildVector. DAGCombine will probably create SPLAT_VECTOR from those build_vectors.
3. SPLAT_VECTOR on fixed vectors causes matchUnaryPredicate to visit the splat value 1 time. BuildUDIV/BuildSDDIV push to the vectors 1 times and call getSplatVector to create SPLAT_VECTOR.
I believe @david-arm is proposing option 3.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96174/new/
https://reviews.llvm.org/D96174
More information about the llvm-commits
mailing list