[llvm] [AMDGPU] Override getRegUsageForType() to fix <N x ptr(7)> crash (PR #126642)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 16:47:39 PST 2025


krzysz00 wrote:

@arsenm I think we might want to go back to the version of the patch that amends `getValueType()` since, with this version of the patch, I found a crash via the SLP vectorizer that goes

```
#12 0x0000000003dd3e5a llvm::EVT::getExtendedVectorVT(llvm::LLVMContext&, llvm::EVT, llvm::ElementCount) /home/kdrewnia/iree/third_party/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:57:21
#13 0x00000000038d224f llvm::TargetLoweringBase::getValueType(llvm::DataLayout const&, llvm::Type*, bool) const /home/kdrewnia/iree/third_party/llvm-project/llvm/include/llvm/CodeGen/TargetLowering.h:1696:3
#14 0x0000000004cbf4b7 llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getTypeLegalizationCost(llvm::Type*) const /home/kdrewnia/iree/third_party/llvm-project/llvm/include/llvm/CodeGen/BasicTTIImpl.h:924:25
#15 0x0000000004cc0ffa llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getNumberOfParts(llvm::Type*) /home/kdrewnia/iree/third_party/llvm-project/llvm/include/llvm/CodeGen/BasicTTIImpl.h:0:42
#16 0x000000000582e36e getFloorFullVectorNumberOfElements(llvm::TargetTransformInfo const&, llvm::Type*, unsigned int) /home/kdrewnia/iree/third_party/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:292:16
```

Haven't isolated a reproducer, but I figured I'd note I might want to go back to a kludge in getValueType()

https://github.com/llvm/llvm-project/pull/126642


More information about the llvm-commits mailing list