Skip to content

Commit

Permalink
Revert "[MemoryLocation] Handle memset_pattern{4,8,16} in getForDest."
Browse files Browse the repository at this point in the history
This reverts commit ac60263.

It looks like the test fails on certain non-Darwin system, even though
the triple is explicitly set to macos. Revert while I investigate.
  • Loading branch information
fhahn committed Dec 14, 2021
1 parent 7abf299 commit ddfac07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions llvm/lib/Analysis/MemoryLocation.cpp
Expand Up @@ -137,9 +137,6 @@ MemoryLocation::getForDest(const CallBase *CB, const TargetLibraryInfo &TLI) {
LibFunc LF;
if (TLI.getLibFunc(*CB, LF) && TLI.has(LF)) {
switch (LF) {
case LibFunc_memset_pattern4:
case LibFunc_memset_pattern8:
case LibFunc_memset_pattern16:
case LibFunc_strncpy:
case LibFunc_strcpy:
case LibFunc_strcat:
Expand Down
12 changes: 9 additions & 3 deletions llvm/test/Transforms/DeadStoreElimination/libcalls-darwin.ll
Expand Up @@ -10,7 +10,9 @@ declare void @memset_pattern16(i8*, i8*, i64)
define void @test_memset_pattern4_const_size(i8* noalias %a, i8* noalias %pattern) {
; CHECK-LABEL: @test_memset_pattern4_const_size(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 17
; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 1
; CHECK-NEXT: store i8 0, i8* [[A_GEP_1]], align 1
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A]], i32 17
; CHECK-NEXT: store i8 1, i8* [[A_GEP_17]], align 1
; CHECK-NEXT: call void @memset_pattern4(i8* [[A]], i8* [[PATTERN:%.*]], i64 17)
; CHECK-NEXT: ret void
Expand Down Expand Up @@ -46,7 +48,9 @@ entry:
define void @test_memset_pattern8_const_size(i8* noalias %a, i8* noalias %pattern) {
; CHECK-LABEL: @test_memset_pattern8_const_size(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 17
; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 1
; CHECK-NEXT: store i8 0, i8* [[A_GEP_1]], align 1
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A]], i32 17
; CHECK-NEXT: store i8 1, i8* [[A_GEP_17]], align 1
; CHECK-NEXT: call void @memset_pattern8(i8* [[A]], i8* [[PATTERN:%.*]], i64 17)
; CHECK-NEXT: ret void
Expand Down Expand Up @@ -82,7 +86,9 @@ entry:
define void @test_memset_pattern16_const_size(i8* noalias %a, i8* noalias %pattern) {
; CHECK-LABEL: @test_memset_pattern16_const_size(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 17
; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr i8, i8* [[A:%.*]], i32 1
; CHECK-NEXT: store i8 0, i8* [[A_GEP_1]], align 1
; CHECK-NEXT: [[A_GEP_17:%.*]] = getelementptr i8, i8* [[A]], i32 17
; CHECK-NEXT: store i8 1, i8* [[A_GEP_17]], align 1
; CHECK-NEXT: call void @memset_pattern16(i8* [[A]], i8* [[PATTERN:%.*]], i64 17)
; CHECK-NEXT: ret void
Expand Down

0 comments on commit ddfac07

Please sign in to comment.