llvm.org GIT mirror llvm / fb3da5c
[PerformanceTips] Provide context on the impact of assume(x) Sean Silva suggested I add something here a while back. Sorry it's taken so long to get back to this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235826 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Reames 4 years ago
2 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
143143 #. When checking a value against a constant, emit the check using a consistent
144144 comparison type. The GVN pass _will_ optimize redundant equalities even if
145145 the type of comparison is inverted, but GVN only runs late in the pipeline.
146 As a result, you may miss the oppurtunity to run other important
146 As a result, you may miss the opportunity to run other important
147147 optimizations. Improvements to EarlyCSE to remove this issue are tracked in
148148 Bug 23333.
149149
155155 intrinsics itself late in the optimization pipeline. It is _very_ rarely
156156 profitable to emit these directly in the language frontend. This item
157157 explicitly includes the use of the :ref:`overflow intrinsics `.
158
159 #. Avoid using the :ref:`assume intrinsic ` until you've
160 established that a) there's no other way to express the given fact and b)
161 that fact is critical for optimization purposes. Assumes are a great
162 prototyping mechanism, but they can have negative effects on both compile
163 time and optimization effectiveness. The former is fixable with enough
164 effort, but the later is fairly fundamental to their designed purpose.
158165
159166 p.s. If you want to help improve this document, patches expanding any of the
160167 above items into standalone sections of their own with a more complete
1028410284
1028510285 This intrinsic is lowered to the ``val``.
1028610286
10287 .. _int_assume:
10288
1028710289 '``llvm.assume``' Intrinsic
1028810290 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1028910291