[PATCH] D129593: [InstCombine] Enable strtol folding with nonnull enptr

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 00:52:19 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: llvm/test/Transforms/InstCombine/str-int-2.ll:43
 
-define i64 @strtol_endptr_not_null() #0 {
+; Fold a call to strtol with an enptr known to be nonnull (the result
+; of pointer decrement).
----------------
enptr -> endptr


================
Comment at: llvm/test/Transforms/InstCombine/str-int-2.ll:52
+;
+  %endm1 = getelementptr inbounds i8*, i8** %pend, i32 -1
+  %call = call i64 @strtol(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8** %endm1, i32 10)
----------------
`i8** nonnull %pend` would be more obvious?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129593



More information about the llvm-commits mailing list