[PATCH] D141680: [GVN] Refactor findDominatingLoad function
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 07:03:47 PST 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:201
unsigned Offset = 0;
+ /// V1, V2 - The dominating non-cloberred values of SelectVal.
+ Value *V1 = nullptr, *V2 = nullptr;
----------------
clobbered
================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:1128
+ if (auto *LI = dyn_cast<LoadInst>(Inst))
+ if (MemoryLocation::get(LI) == Loc)
+ return LI;
----------------
Can you please add a test where the loads have the same size but different types? I think you need to compare pointer and type here, not location.
================
Comment at: llvm/test/Transforms/GVN/PRE/pre-load-through-select.ll:80
+ ret i32 %res.2
+}
+
----------------
Precommit test please.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141680/new/
https://reviews.llvm.org/D141680
More information about the llvm-commits
mailing list