From bcc06085a894aa52f094e12a8cfdd36ae1f175af Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Sun, 7 Sep 2014 22:58:14 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenFunction.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index c03b9ab26b3..4841b535062 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1743,6 +1743,10 @@ public: bool isInc, bool isPre); ComplexPairTy EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre); + + void EmitAlignmentAssumption(llvm::Value *PtrValue, unsigned Alignment, + llvm::Value *OffsetValue = nullptr); + //===--------------------------------------------------------------------===// // Declaration Emission //===--------------------------------------------------------------------===// -- cgit v1.2.3