[llvm] [IR] "modular-format" attribute for functions using format strings (PR #147429)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 13:44:00 PST 2025


================
@@ -0,0 +1,105 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; Test that the modular format string library call simplifier works correctly.
+;
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+
+ at .str.int = constant [3 x i8] c"%d\00"
+ at .str.float = constant [3 x i8] c"%f\00"
+ at .str.multi = constant [6 x i8] c"%f %d\00"
+ at .str.noargs = constant [1 x i8] c"\00"
+
+; No aspects are specified, so no transformation occurs.
----------------
mysterymath wrote:

Thanks, done.

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


More information about the llvm-commits mailing list