[PATCH] D124327: [SCCP] Add initial support for propagation through freeze.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 07:57:06 PDT 2022


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

I tested this patch, and it folds

  @g = external global i8
  
  define i64 @test() {
    %x = freeze i64 add nuw (i64 ptrtoint (ptr @g to i64), i64 1)
    ret i64 %x
  }

to

  @g = external global i8
  
  define i64 @test() {
    ret i64 add nuw (i64 ptrtoint (ptr @g to i64), i64 1)
  }

which is clearly not right due to the presence of the `nuw` flag. This needs an isGuaranteedNotToBeUndefOrPoison check for the constant value.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124327/new/

https://reviews.llvm.org/D124327



More information about the llvm-commits mailing list