Skip to content

suboptimal code generation in strlen constant folding #11553

@llvmbot

Description

@llvmbot
Bugzilla Link 11181
Resolution FIXED
Resolved on Oct 19, 2011 19:34
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

target datalayout = "e-p:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64"

declare i32 @​strlen(i8* noalias nocapture) nounwind readonly
@​nullstring = internal constant i8 0

define i32 @​main() {
%len = tail call i32 @​strlen(i8* @​nullstring) nounwind
ret i32 %len
}

strlen does not seem to look at the data behind @​nullstring when it does not have a specific format

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