[PATCH] D155743: [AggressiveInstCombine] Fold strcmp for short string literals with size 2

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 09:28:44 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:1002
+    Value *CharacterSub =
+        B.CreateNSWSub(StrCharacterValue, ConstantStrCharacterValue);
+    Value *IsCharacterSubZero =
----------------
goldstein.w.n wrote:
> is NSW right?
Likewise, do you need the sub at all? Can you just br on the compare of the two characters and return the compare result itself?


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

https://reviews.llvm.org/D155743



More information about the llvm-commits mailing list