[PATCH] D91444: [InstCombine] Preserve !annotation metadata for memory combines.

2020-12-16 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision.
lebedev.ri added a comment.

In D91444#2458024 , @fhahn wrote:

> In D91444#2394512 , @lebedev.ri 
> wrote:
>
>> What about teaching IRBuilder to deal with it like it deals with debugloc?
>
> Done! Together with D93400  this patch now 
> boils down to requesting !annotation to be preserved for instructions created 
> by IRBuilder.

Yay, now this does look good to me.
Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91444/new/

https://reviews.llvm.org/D91444

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91444: [InstCombine] Preserve !annotation metadata for memory combines.

2020-12-16 Thread Francis Visoiu Mistrih via Phabricator via cfe-commits
thegameg accepted this revision.
thegameg added a comment.
This revision is now accepted and ready to land.

LGTM, nice!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91444/new/

https://reviews.llvm.org/D91444

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91444: [InstCombine] Preserve !annotation metadata for memory combines.

2020-12-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 312216.
fhahn added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In D91444#2394512 , @lebedev.ri wrote:

> What about teaching IRBuilder to deal with it like it deals with debugloc?

Done! Together with D93400  this patch now 
boils down to requesting !annotation to be preserved for instructions created 
by IRBuilder.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91444/new/

https://reviews.llvm.org/D91444

Files:
  clang/test/CodeGenCXX/auto-var-init.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/annotations.ll

Index: llvm/test/Transforms/InstCombine/annotations.ll
===
--- llvm/test/Transforms/InstCombine/annotations.ll
+++ llvm/test/Transforms/InstCombine/annotations.ll
@@ -48,8 +48,8 @@
 
 define void @copy_1_byte(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @copy_1_byte({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* %d, i8* %s, i32 1, i1 false), !annotation !0
@@ -60,8 +60,8 @@
 
 define void @libcallcopy_1_byte(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @libcallcopy_1_byte({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call i8* @memcpy(i8* %d, i8* %s, i64 1), !annotation !0
@@ -72,8 +72,8 @@
 
 define void @libcallcopy_1_byte_chk(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @libcallcopy_1_byte_chk({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call i8* @__memcpy_chk(i8* %d, i8* %s, i64 1, i64 1), !annotation !0
@@ -84,8 +84,8 @@
 
 define void @move_1_byte(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @move_1_byte({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call void @llvm.memmove.p0i8.p0i8.i32(i8* %d, i8* %s, i32 1, i1 false), !annotation !0
@@ -96,8 +96,8 @@
 
 define void @libcallmove_1_byte(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @libcallmove_1_byte({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call i8* @memmove(i8* %d, i8* %s, i64 1), !annotation !0
@@ -108,8 +108,8 @@
 
 define void @libcallmove_1_byte_chk(i8* %d, i8* %s) {
 ; CHECK-LABEL: define {{.+}} @libcallmove_1_byte_chk({{.+}}
-; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
-; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1
+; CHECK-NEXT:[[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
+; CHECK-NEXT:store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call i8* @__memmove_chk(i8* %d, i8* %s, i64 1, i64 1), !annotation !0
@@ -120,7 +120,7 @@
 
 define void @set_1_byte(i8* %d) {
 ; CHECK-LABEL: define {{.+}} @set_1_byte({{.+}}
-; CHECK-NEXT:store i8 1, i8* [[D:%.*]], align 1
+; CHECK-NEXT:store i8 1, i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call void @llvm.memset.p0i8.i32(i8* %d, i8 1, i32 1, i1 false), !annotation !0
@@ -131,7 +131,7 @@
 
 define void @libcall_set_1_byte(i8* %d) {
 ; CHECK-LABEL: define {{.+}} @libcall_set_1_byte({{.+}}
-; CHECK-NEXT:store i8 1, i8* [[D:%.*]], align 1
+; CHECK-NEXT:store i8 1, i8* [[D:%.*]], align 1, !annotation [[ANN]]
 ; CHECK-NEXT:ret void
 ;
   call i8* @memset(i8* %d, i32 1, i64 1), !annotation !0
@@ -142,7 +142,7 @@
 
 define void @libcall_set_1_byte_chk(i8* %d) {
 ; CHECK-LABEL: define {{.+}} @libcall_set_1_byte_chk({{.+}}
-; CHECK-NEXT:store i8 1, i8* [[D:%.*]], align 1
+;