[PATCH] D54956: [ValueTracking] Look through casts when determining non-nullness
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 27 13:44:38 PST 2018
jdoerfert marked 4 inline comments as done.
jdoerfert added inline comments.
================
Comment at: lib/Analysis/ValueTracking.cpp:2024
+ // Look through various operations and instructions which do not alter the
+ // value, or at least not the nullness property of the value (sext/zext).
+ if (const BitCastOperator *BCO = dyn_cast<BitCastOperator>(V))
----------------
fhahn wrote:
> The dyn_casts are not strictly necessary I think and using a switch on the opcode might be a little bit more compact, together with getOperand(0). But it doesn't really make a big difference.
The switch is not much nicer, I think. Especially since I don't know how to add the operators, e.g., constant bitcast expressions, in the switch. Does anybody feel strongly about this?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54956/new/
https://reviews.llvm.org/D54956
More information about the llvm-commits
mailing list