diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-09-07 22:58:14 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-09-07 22:58:14 +0000 |
commit | bcc06085a894aa52f094e12a8cfdd36ae1f175af (patch) | |
tree | 5d932a55113890c2447f77376b89f3e48f36c8b0 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | cebf0cc210edeb839894b0e93da1c5787bd5b68b (diff) | |
download | llvm-bcc06085a894aa52f094e12a8cfdd36ae1f175af.zip llvm-bcc06085a894aa52f094e12a8cfdd36ae1f175af.tar.gz llvm-bcc06085a894aa52f094e12a8cfdd36ae1f175af.tar.bz2 |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index c03b9ab..4841b53 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 //===--------------------------------------------------------------------===// |