[llvm] [GVN] Look through select/phi when determining underlying object (PR #99509)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 20:44:28 PDT 2024


================
@@ -736,6 +736,10 @@ inline Value *getUnderlyingObject(Value *V, unsigned MaxLookup = 6) {
   return const_cast<Value *>(getUnderlyingObject(VConst, MaxLookup));
 }
 
+/// Like getUnderlyingObject(), but will try harder to find a single underlying
+/// object. In particular, this function also looks through selects and phis.
+const Value *getUnderlyingObjectAggressive(const Value *V);
----------------
tschuett wrote:

Could you still expose a parameter to control the aggressiveness? Aggressive without a parameter is kind of scary. E.g. the size of the visited set?

https://github.com/llvm/llvm-project/pull/99509


More information about the llvm-commits mailing list