Skip to content

Global "NaN" Is Lowered to 0.0 During LLVM Conversion #559

Closed
@orbiri

Description

@orbiri

While skimming through failing SingleSource files, I randomly picked GCC-C-execute-ieee-fp-cmp-3. While bisecting the issue with it, I came across a cute bug with an extremely slow reproducer:

module @m attributes {cir.lang = #cir.lang<c>, llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"} {
  cir.global external @fnan = #cir.fp<0x7FC00000> : !cir.float
}

cir-opt --cir-to-llvm =>

module @m attributes {llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"} {
  llvm.mlir.global external @fnan(0.000000e+00 : f32) {addr_space = 0 : i32} : f32
}

I hope to address this issue myself in the coming days :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions