Page MenuHomePhabricator

MemoryBuiltins: replace most users of isFreeCall with isFreeLikeCall
AbandonedPublic

Authored by durin42 on Apr 25 2022, 5:16 PM.

Details

Summary

With our new attributes-based approach to handling allocator functions,
we need to differentiate between "is this literally free()" and "is this
a function which frees the given pointer." This change introduces the
new function to check for the latter category and moves the easy cases
throughout the codebase to check that instead of literally-free().

Diff Detail

Unit TestsFailed

TimeTest
60,110 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/scariness_score_test.cpp.tmp
2,170 msx64 debian > LLVM.Examples/OrcV2Examples::lljit-with-remote-debugging.test
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/LLJITWithRemoteDebugging /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Examples/OrcV2Examples/Inputs/argc_sub1_elf.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck --check-prefix=CHECK0 /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
60,040 msx64 debian > libFuzzer.libFuzzer::fuzzer-leak.test
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest
60,040 msx64 debian > libFuzzer.libFuzzer::large.test
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/LargeTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/large.test.tmp-LargeTest
60,020 msx64 debian > libFuzzer.libFuzzer::minimize_crash.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/NullDerefTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/minimize_crash.test.tmp-NullDerefTest
View Full Test Results (7 Failed)

Event Timeline

durin42 created this revision.Apr 25 2022, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2022, 5:16 PM
durin42 requested review of this revision.Apr 25 2022, 5:16 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
durin42 updated this revision to Diff 425367.Apr 26 2022, 5:35 PM
durin42 edited the summary of this revision. (Show Details)
durin42 updated this revision to Diff 425499.Apr 27 2022, 6:05 AM
durin42 updated this revision to Diff 425842.Apr 28 2022, 10:34 AM
durin42 updated this revision to Diff 426090.Apr 29 2022, 9:29 AM
durin42 updated this revision to Diff 426098.Apr 29 2022, 9:35 AM
durin42 updated this revision to Diff 426410.May 2 2022, 7:04 AM
durin42 updated this revision to Diff 426735.May 3 2022, 8:47 AM
durin42 updated this revision to Diff 426777.May 3 2022, 10:45 AM
durin42 updated this revision to Diff 427091.May 4 2022, 11:37 AM
durin42 updated this revision to Diff 427756.May 6 2022, 2:40 PM
ormris removed a subscriber: ormris.May 16 2022, 10:58 AM
durin42 updated this revision to Diff 430162.May 17 2022, 12:28 PM
durin42 updated this revision to Diff 431700.May 24 2022, 9:45 AM
bogner added a subscriber: bogner.Jun 14 2022, 1:02 PM

This affects tests a bit more than I'd expect - I guess these are test issues where we weren't calling the builtin free for one reason or another. Would it be better to fix up the tests so that they do the right things without this change beforehand to make it obvious that this isn't changing behaviour in a weird way?

durin42 updated this revision to Diff 444096.Tue, Jul 12, 3:47 PM

This affects tests a bit more than I'd expect - I guess these are test issues where we weren't calling the builtin free for one reason or another. Would it be better to fix up the tests so that they do the right things without this change beforehand to make it obvious that this isn't changing behaviour in a weird way?

Maybe. Do you have some exemplars in mind here that change in ways you don't expect? I've been looking at this patch so long it just seems obviously-the-way-it-is to me now...for good or for ill.

durin42 updated this revision to Diff 445899.Tue, Jul 19, 11:57 AM
durin42 updated this revision to Diff 446191.Wed, Jul 20, 9:56 AM
durin42 updated this revision to Diff 446204.Wed, Jul 20, 10:35 AM