Skip to content

Assertion `BitWidth == DL.getIndexTypeSizeInBits(getType()) && "The offset bit width does not match the DL specification."' failed #134008

Closed
@ShuoerWang542

Description

@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.

APInt Offset(DL.getTypeSizeInBits(Address->getType()), 0);
Address = Address->stripAndAccumulateInBoundsConstantOffsets(DL, Offset);

DL.getTypeSizeInBits is used, but inside stripAndAccumulateInBoundsConstantOffsets function:

assert(BitWidth == DL.getIndexTypeSizeInBits(getType()) &&

DL.getIndexTypeSizeInBits is used for assertion. If the DataLayout of an address space p[n]:<size>:<abi>[:<pref>][:<idx>] has different size and idx, the assertion would fail.

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

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]debuginfollvm:SelectionDAGSelectionDAGISel as well

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions