diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td --- a/llvm/include/llvm/IR/Intrinsics.td +++ b/llvm/include/llvm/IR/Intrinsics.td @@ -518,9 +518,13 @@ def int_readcyclecounter : Intrinsic<[llvm_i64_ty]>; -// The assume intrinsic is marked as arbitrarily writing so that proper -// control dependencies will be maintained. +// The assume intrinsic is *not* marked as speculatable but without memory +// effects. Proper control dependencies will be maintained because weakening +// them would potentially introduce UB on paths that did not contain it before. def int_assume : Intrinsic<[], [llvm_i1_ty], [IntrWillReturn, + IntrNoMem, + IntrNoSync, + IntrNoFree, NoUndef>]>; // Stack Protector Intrinsic - The stackprotector intrinsic writes the stack