[PATCH] D103856: [Attributor] Introduce a helper do deal with constant type mismatches
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 10 15:25:24 PDT 2021
jdoerfert added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:4637
// We can replace the AssociatedValue with the constant.
- if (!V.user_empty() && &V != C && V.getType() == C->getType()) {
- LLVM_DEBUG(dbgs() << "[ValueSimplify] " << V << " -> " << *C
+ if (!V.user_empty() && &V != C && NewV) {
+ LLVM_DEBUG(dbgs() << "[ValueSimplify] " << V << " -> " << *NewV
----------------
kuter wrote:
> NIT: &V != C is already checked and must be true.
Good point, I wanted NewV != C. Will be fixed.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:4782
: UndefValue::get(V.getType());
- if (C) {
+ if (C && C != &V) {
auto PredForReturned =
----------------
kuter wrote:
> I think the associated value for a `RETURNED` position is the value to the function itself so I don't think it makes sense to do this check.
You are right. I'll remove the V checks here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103856/new/
https://reviews.llvm.org/D103856
More information about the llvm-commits
mailing list