[llvm] [LLVM] Add new attribute has_fake_use for llvm.fake.use-specific logic (PR #109997)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 08:07:08 PDT 2024


================
@@ -74,9 +74,9 @@ INITIALIZE_PASS_END(RemoveLoadsIntoFakeUses, DEBUG_TYPE,
                     "Remove Loads Into Fake Uses", false, false)
 
 bool RemoveLoadsIntoFakeUses::runOnMachineFunction(MachineFunction &MF) {
-  // Only `optdebug` functions should contain FAKE_USEs, so don't try to run
-  // this for other functions.
-  if (!MF.getFunction().hasFnAttribute(Attribute::OptimizeForDebugging) ||
+  // Only `has_fake_uses` functions should contain FAKE_USEs, so don't try to
+  // run this for other functions.
+  if (!MF.getFunction().hasFnAttribute(Attribute::HasFakeUses) ||
----------------
nikic wrote:

Is this the only use of the attribute? If it's just a pure compile time optimization, you can track whether there are FAKE_USEs on the MachineFunction.

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


More information about the llvm-commits mailing list