[clang] [llvm] [LFI][X86] Add X86 LFI target and system instruction rewrites (PR #189569)

Zachary Yedidia via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 01:03:47 PDT 2026


================
@@ -921,8 +923,10 @@ class Triple {
 
   /// Tests whether the target is LFI.
   bool isLFI() const {
-    return getArch() == Triple::aarch64 &&
-           getSubArch() == Triple::AArch64SubArch_lfi;
+    return (getArch() == Triple::aarch64 &&
+            getSubArch() == Triple::AArch64SubArch_lfi) ||
+           (getArch() == Triple::x86_64 &&
+            getSubArch() == Triple::X86_64SubArch_lfi);
----------------
zyedidia wrote:

It's not strictly necessary, I've just done it that way for consistency with other uses of sub-architectures like the check in `isWindowsArm64EC()` that checks `getArch() == Triple::aarch64 && getSubArch() == Triple::AArch64SubArch_arm64ec`.

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


More information about the cfe-commits mailing list