[llvm] llc: Construct RuntimeLibraryInfoWrapper with correct triple (PR #176798)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 19 10:40:54 PST 2026
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/176798
The target option processing here is unnecessarily confusing
and buggy. Depending on the combination of -march, -mtriple, and
an explicit module in the triple, the triple won't be set in the
IR module. "TheTriple" should be the one consistent with the
constructed TargetMachine.
This avoids a behavior change when SelectionDAG is switched to
using LibcallLoweringInfo.
>From eb7cf775f75b120cc7704aca72bbdbdabe3b9f11 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Mon, 19 Jan 2026 19:23:49 +0100
Subject: [PATCH] llc: Construct RuntimeLibraryInfoWrapper with correct triple
The target option processing here is unnecessarily confusing
and buggy. Depending on the combination of -march, -mtriple, and
an explicit module in the triple, the triple won't be set in the
IR module. "TheTriple" should be the one consistent with the
constructed TargetMachine.
This avoids a behavior change when SelectionDAG is switched to
using LibcallLoweringInfo.
---
llvm/tools/llc/llc.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 6ee615db60a1e..dc744655efba9 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -752,9 +752,9 @@ static int compileModule(char **argv, SmallVectorImpl<PassPlugin> &PluginList,
legacy::PassManager PM;
PM.add(new TargetLibraryInfoWrapperPass(TLII));
PM.add(new RuntimeLibraryInfoWrapper(
- M->getTargetTriple(), Target->Options.ExceptionModel,
- Target->Options.FloatABIType, Target->Options.EABIVersion,
- Options.MCOptions.ABIName, Target->Options.VecLib));
+ TheTriple, Target->Options.ExceptionModel, Target->Options.FloatABIType,
+ Target->Options.EABIVersion, Options.MCOptions.ABIName,
+ Target->Options.VecLib));
{
raw_pwrite_stream *OS = &Out->os();
More information about the llvm-commits
mailing list