[llvm] [MTE] Do not allow local aliases to MTE globals (PR #106280)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:54:07 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Florian Mayer (fmayer)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/106280.diff


1 Files Affected:

- (modified) llvm/lib/IR/Globals.cpp (+4) 


``````````diff
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index 2bc69cdb712b0a..6b502a08b87d08 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -110,6 +110,10 @@ bool GlobalValue::isInterposable() const {
 }
 
 bool GlobalValue::canBenefitFromLocalAlias() const {
+  if (isTagged()) {
+    // Cannot create local aliases to MTE tagged globals.
+    return false;
+  }
   // See AsmPrinter::getSymbolPreferLocal(). For a deduplicate comdat kind,
   // references to a discarded local symbol from outside the group are not
   // allowed, so avoid the local alias.

``````````

</details>


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


More information about the llvm-commits mailing list