[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 3 05:29:20 PST 2015


On 11/2/2015 5:57 PM, Richard Diamond via llvm-dev wrote:
>
> Add a new intrinsic, called `llvm.blackbox`, which accepts a value of
> any type and returns a value of the same type. As with many other
> intrinsics, this intrinsic shall remain unknown to all optimizations,
> before and during codegen. Specifically, this intrinsic should prevent
> all optimizations which operate by assuming properties of the value
> passed to the intrinsic. Once the last optimization pass (of any kind)
> is finished, all calls can be RAUW its argument.

This would not prevent dead code elimination from removing it.  The 
intrinsic would need to have some sort of a side-effect in order to be 
preserved in all cases.  Are you concerned about cases where the user of 
the intrinsic is dead?

-Krzysztof

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list