Skip to content

[GlobalIsel] Assertion when generating code for ptrtoint with vector operands #150875

@arichardson

Description

@arichardson

The following IR when run with llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs

define <2 x i64> @ptrtoint_vec(<2 x ptr> %p) {
entry:
  %addr = ptrtoint <2 x ptr> %p to <2 x i64>
  %ret = xor <2 x i64> %addr, <i64 -1, i64 -1>
  ret <2 x i64> %ret
}

triggers the following assertion:

llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp:1428: virtual MachineInstrBuilder llvm::MachineIRBuilder::buildInstr(unsigned int, ArrayRef, ArrayRef, std::optional): Assertion `(TypeSize::ScalarTy)SrcOps.size() * SrcOps[0].getLLTTy(*getMRI()).getSizeInBits() == DstOps[0].getLLTTy(*getMRI()).getSizeInBits() && "input scalars do not exactly cover the output vector register"' failed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions