[PATCH] D114872: [MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 12:33:30 PST 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Analysis/MemoryLocation.cpp:143
+    case LibFunc_strncat:
+      return getForArgument(CB, 0, &TLI);
+    default:
----------------
nikic wrote:
> reames wrote:
> > I might be missing something, but it looks like these are only handled generically inside MemoryLocation::getForArgument at the moment.  Given the original code specialized for the constant case, and only returned getAfter (not also before), I think this move is not NFC.  
> The strncpy logic is added in the parent patch. You're right though that we lose the getAfter/getBeforeOrAfter distinction (though it probably doesn't matter much).
Yeah, I guess we could add the various `LibFunc_str*` variants to the switch in getForArgument to use `getAfter` for them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114872/new/

https://reviews.llvm.org/D114872



More information about the llvm-commits mailing list