diff options
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 3 | ||||
| -rw-r--r-- | llvm/test/Transforms/CodeGenPrepare/invariant.group.ll | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 0ae57ce0c36..bc333b95ee0 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -5735,6 +5735,5 @@ bool CodeGenPrepare::splitBranchCondition(Function &F) { } void CodeGenPrepare::stripInvariantGroupMetadata(Instruction &I) { - if (auto *InvariantMD = I.getMetadata(LLVMContext::MD_invariant_group)) - I.dropUnknownNonDebugMetadata(InvariantMD->getMetadataID()); + I.setMetadata(LLVMContext::MD_invariant_group, nullptr); } diff --git a/llvm/test/Transforms/CodeGenPrepare/invariant.group.ll b/llvm/test/Transforms/CodeGenPrepare/invariant.group.ll index e8f1e42ddcb..bde04a552df 100644 --- a/llvm/test/Transforms/CodeGenPrepare/invariant.group.ll +++ b/llvm/test/Transforms/CodeGenPrepare/invariant.group.ll @@ -7,8 +7,8 @@ define void @foo() { enter: ; CHECK-NOT: !invariant.group ; CHECK-NOT: @llvm.invariant.group.barrier( - ; CHECK: %val = load i8, i8* @tmp - %val = load i8, i8* @tmp, !invariant.group !0 + ; CHECK: %val = load i8, i8* @tmp, !tbaa + %val = load i8, i8* @tmp, !invariant.group !0, !tbaa !{!1, !1, i64 0} %ptr = call i8* @llvm.invariant.group.barrier(i8* @tmp) ; CHECK: store i8 42, i8* @tmp @@ -20,4 +20,5 @@ enter: declare i8* @llvm.invariant.group.barrier(i8*) -!0 = !{!"something"}
\ No newline at end of file +!0 = !{!"something"} +!1 = !{!"x", !0} |

