HomePhabricator

Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.

Description

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.

Details

Committed
hfinkelSep 7 2014, 3:58 PM
Parents
rL217348: Make use @llvm.assume for loop guards in ScalarEvolution
Branches
Unknown
Tags
Unknown

Event Timeline