[PATCH] D51410: [SLC] Add an alignment to printf->puts global string
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 3 01:50:49 PDT 2018
dmgreen updated this revision to Diff 163669.
dmgreen added a comment.
Moved to CreateGlobalString
https://reviews.llvm.org/D51410
Files:
lib/IR/IRBuilder.cpp
test/Transforms/InstCombine/printf-1.ll
Index: test/Transforms/InstCombine/printf-1.ll
===================================================================
--- test/Transforms/InstCombine/printf-1.ll
+++ test/Transforms/InstCombine/printf-1.ll
@@ -14,7 +14,7 @@
@percent_f = constant [3 x i8] c"%f\00"
@percent_s = constant [4 x i8] c"%s\0A\00"
@empty = constant [1 x i8] c"\00"
-; CHECK: [[$STR:@[a-z0-9]+]] = private unnamed_addr constant [12 x i8] c"hello world\00"
+; CHECK: [[$STR:@[a-z0-9]+]] = private unnamed_addr constant [12 x i8] c"hello world\00", align 1
declare i32 @printf(i8*, ...)
Index: lib/IR/IRBuilder.cpp
===================================================================
--- lib/IR/IRBuilder.cpp
+++ lib/IR/IRBuilder.cpp
@@ -50,6 +50,7 @@
nullptr, GlobalVariable::NotThreadLocal,
AddressSpace);
GV->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);
+ GV->setAlignment(1);
return GV;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51410.163669.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180903/836767bb/attachment.bin>
More information about the llvm-commits
mailing list