Search Unity

Burst no alias hint

Discussion in 'Burst' started by sebas77, Dec 31, 2019.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    The Burst documentation is a bit outdated. In my case specifically:

    Aliasing Checks
    Since aliasing is so key to the compilers ability to optimize for performance, we've added some experimental aliasing intrinsics:

    • Unity.Burst.Aliasing.ExpectAlias expects that the two pointers do alias, and generates a compiler error if not.
    • Unity.Burst.Aliasing.ExpectNoAlias expects that the two pointers do not alias, and generates a compiler error if not.
    Unity.Burst.Aliasing doesn't exist anymore. I need to instruct Burst to disable Alias checks, as I am sure there is no aliasing. How?
     
  2. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    I guess it's the NoAlias attribute that must be set on the parameters. I'll do some tests.
     
  3. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Yeah you want the NoAlias attribute on the parameters.

    The experimental Aliasing intrinsics are for ensuring that the compiler definitely knows that something does or does not alias - they will generate compiler errors if it doesn't (its a way for us to try and give you, the user, more insight into what the compiler thinks).

    I hope to have them non-experimental in the Burst 1.3.0 timeframe (so a little while away yet).