Issue 134008
Summary Assertion `BitWidth == DL.getIndexTypeSizeInBits(getType()) && "The offset bit width does not match the DL specification."' failed
Labels new issue
Assignees
Reporter ShuoerWang542
    llvm-project/llvm/lib/IR/Value.cpp:711: const llvm::Value *llvm::Value::stripAndAccumulateConstantOffsets(const llvm::DataLayout &, llvm::APInt &, bool, bool, function_ref<bool (llvm::Value &, llvm::APInt &)>) const: Assertion `BitWidth == DL.getIndexTypeSizeInBits(getType()) && "The offset bit width does not match the DL specification."' failed.

https://github.com/llvm/llvm-project/blob/1a4dc189ad26ced9d9a74e40fa50b7d81428edba/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp#L1567-L1568

_DL.getTypeSizeInBits_ is used, but inside _stripAndAccumulateInBoundsConstantOffsets_ function:

https://github.com/llvm/llvm-project/blob/1a4dc189ad26ced9d9a74e40fa50b7d81428edba/llvm/lib/IR/Value.cpp#L723

_DL.getIndexTypeSizeInBits_ is used for assertion. If the DataLayout of an address space is for example 64:64:64:32, the IndexTypeSize would not match the TypeSize, causing the assertion fail.

Is this intended? the type size and index size has to match here?

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to