Commit Graph

4 Commits

Author SHA1 Message Date
NAKAMURA Takumi 6ed6ef7ac2 clang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.
llvm-svn: 218507
2014-09-26 09:37:15 +00:00
Hal Finkel ee90a223ea Support the assume_aligned function attribute
In addition to __builtin_assume_aligned, GCC also supports an assume_aligned
attribute which specifies the alignment (and optional offset) of a function's
return value. Here we implement support for the assume_aligned attribute by making
use of the @llvm.assume intrinsic.

llvm-svn: 218500
2014-09-26 05:04:30 +00:00
NAKAMURA Takumi 4b04c11d00 clang/test/CodeGen/builtin-assume*.c: Fixup for -Asserts.
llvm-svn: 217352
2014-09-08 01:12:55 +00:00
Hal Finkel bcc06085a8 Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.
This makes use of the recently-added @llvm.assume intrinsic to implement a
__builtin_assume(bool) intrinsic (to provide additional information to the
optimizer). This hooks up __assume in MS-compatibility mode to mirror
__builtin_assume (the semantics have been intentionally kept compatible), and
implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM
now contains special logic to deal with assumptions of this form.

llvm-svn: 217349
2014-09-07 22:58:14 +00:00