Skip to content

@​llvm.assume is ignored in case of pointer values #24268

@llvmbot

Description

@llvmbot
Bugzilla Link 23894
Version trunk
OS Linux
Attachments testcase
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

@​llvm.assume does not trigger constant propgation in case of pointer values.

eg No constant propagation is done to the return statement for the following code:

struct X { unsigned long long* a; };
unsigned long long* fail(X* x)
{
  __builtin_assume(x->a == (unsigned long long*)12345678);
  return x->a;
}

While for the following code this works as expected:

struct Y { unsigned long long a; };
unsigned long long ok(Y* y)
{
  __builtin_assume(y->a == 12345678);
  return y->a;
}

The attached testcase can be used to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions