Skip to content

clang generate i128 for opencl source but same C/CPP source generate i64 type #134965

@haonanya1

Description

@haonanya1

With the following source, opencl generate i128 but cpp generate i64

void ref_matmul() {
  const __auto_type bin_arg_glob_off = -9223372036854775808L ;
}

opencl IR generated by the command clang++ -cc1 -x cl 2.cl -cl-std=CL2.0 -triple spir64-unknown-unknown -emit-llvm -O0

; Function Attrs: convergent noinline norecurse nounwind optnone
define dso_local spir_func void @ref_matmul() #0 {
entry:
  %bin_arg_glob_off = alloca i128, align 16
  store i128 -9223372036854775808, ptr %bin_arg_glob_off, align 16
  ret void
}

cpp IR generated by the command clang++ 1.cpp -o 1.ll -S -emit-llvm -O0

; Function Attrs: mustprogress noinline nounwind optnone uwtable
define dso_local void @_Z10ref_matmulv() #0 {
  %1 = alloca i64, align 8
  store i64 -9223372036854775808, ptr %1, align 8
  ret void
}

c IR generated by the command clang 1.c -o 1.ll -S -emit-llvm -O0

; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @ref_matmul() #0 {
  %1 = alloca i64, align 8
  store i64 -9223372036854775808, ptr %1, align 8
  ret void
}


is it expected?

@svenvh , thanks very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenCLclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions