Skip to content

more precise aliasing information #11561

@llvmbot

Description

@llvmbot
Bugzilla Link 11189
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

Hello,

I'm using a structure {i32, [0 x i8]} where I store a value into
getelementptr {i32, [0 x i8]}, i32 0, i32 0
after that, I use
getelementptr {i32, [0 x i8]}, i32 0, i32 1
and pass the value to a stdlib call like puts or fwrite.
After this, I read
getelementptr {i32, [0 x i8]}, i32 0, i32 0
again and the value could not constant folded.

I would like to have more attributes for functions and parameters like:

  • io (for functions) - indicates that a function does io, but does not manipulate any internal memory
  • nobelow (for parameters) - indicates that the function does not read memory that lies below this pointer; maybe we need a more precise value from where the memory starts
  • endsatzero (for parameters) - indicates that the function will not read memory above the first occurance of i8 0 in the memory

the nobelow and endsatzero could be represented as a range, too:

  • (0..4) for a i32*
  • (0..zero) for a i8* string
  • (0..) for an array
  • (..) for some hacky struct
  • (..12) for other hacky structs (for example selinux in xorg)

This would optimize array access, too because the compiler knows which element is accessed and that the inner function does not work with other than the one element it got passed to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillallvmUmbrella label for LLVM issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions