Skip to content

llvm: assertion triggered when casting non-register-sized integer to float #17381

@jacobly0

Description

@jacobly0
export fn entry() void {
    var a: u15 = 42;
    var b: f32 = @floatFromInt(a);
    _ = b;
}
$ zig build-obj repro.zig -mcpu x86_64+avx512f
LLVM Emit Object... zig: llvm/include/llvm/CodeGen/ValueTypes.h:300: MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed.
Aborted (core dumped)

This bug is currently triggered by this code when compiling the compiler under the proper circumstances (don't look at the cast direction too closely 🙄).

upstream: llvm/llvm-project#68068

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86backend-llvmThe LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorupstreamAn issue with a third party project that Zig uses.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions