Skip to content

The bitwise-instruction optimizer doesn't know about alignment of globals. #2578

@llvmbot

Description

@llvmbot
Bugzilla Link 2206
Resolution FIXED
Resolved on Apr 19, 2008 17:18
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @sunfishcode

Extended Description

Consider "i64 and (i64 ptrtoint (i64 (i64)* @​cons to i64), i64 -8)"[1].
(Where @​cons is a global function with an alignment >= 8 specified)
Such expressions aren't simplified by "opt -std-compile-opts", even though the relevant bits of the ptrtoint result are guaranteed to be zero because of above-mentioned alignment and similar optimizations are performed if the pointer is replaced by an integer.

[1]: That expression was shortened for readability, and not actually tested in this form. The actual expression was "i64 inttoptr (i64 and (i64 or (i64 ptrtoint (i64 (i64)* @​cons to i64), i64 1), i64 -8) to i64 (i64)*)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions