Skip to content

[InstCombine] Failure to simplify usub.with.overflow+null check of non-null base pointer #42596

@LebedevRI

Description

@LebedevRI
Bugzilla Link 43251
Version trunk
OS Linux
CC @RKSimon,@nikic,@rotateright,@vedantk
Fixed by commit(s) 371718, 371921, 372257, 372341, 372912, 372928, 372930

Extended Description

Again comes up in https://reviews.llvm.org/D67122
for

char* test(char& base, unsigned long offset) {
  return &base - offset;
}

We produce

https://godbolt.org/z/luGEju

and fail to simplify further, but we can:

https://rise4fun.com/Alive/Ppo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillallvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions