[PATCH] D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument.
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 09:32:16 PST 2021
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1348
-static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I);
+static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I, bool *IsUndefinedFromGEP = nullptr);
----------------
Why does this pass a pointer to bool, rather than just a bool?
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6609
+ // Passing null to a nonnnull+noundef argument is undefined.
+ return true;
+ }
----------------
I would expect this to be something like `return !IsUndefinedFromGEP`, with `IsUndefinedFromGEP` being a simple bool.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94180/new/
https://reviews.llvm.org/D94180
More information about the llvm-commits
mailing list