- 
                Notifications
    You must be signed in to change notification settings 
- Fork 15k
Closed
Labels
Description
| 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.