[llvm] [llvm][X86] AvoidTrailingCallPass for UEFI (PR #138363)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 16:35:59 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: Prabhu Rajasekaran (Prabhuk)

<details>
<summary>Changes</summary>

Enable X86AvoidTrailingCallPass for UEFI X86_64 bit target.


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


1 Files Affected:

- (modified) llvm/lib/Target/X86/X86AvoidTrailingCall.cpp (+2-1) 


``````````diff
diff --git a/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp b/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
index 2ecf49382d29f..3aea3704c46ed 100644
--- a/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
+++ b/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
@@ -82,7 +82,8 @@ static bool isCallInstruction(const MachineInstr &MI) {
 bool X86AvoidTrailingCallPass::runOnMachineFunction(MachineFunction &MF) {
   const X86Subtarget &STI = MF.getSubtarget<X86Subtarget>();
   const X86InstrInfo &TII = *STI.getInstrInfo();
-  assert(STI.isTargetWin64() && "pass only runs on Win64");
+  assert((STI.isTargetWin64() || STI.isTargetUEFI64()) &&
+         "pass only runs on Win64 and UEFI64");
 
   // We don't need to worry about any of the invariants described above if there
   // is no unwind info (CFI).

``````````

</details>


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


More information about the llvm-commits mailing list