Page MenuHomePhabricator

[IRSim][IROutliner] Canonicalizing commutative value numbering between similarity sections.
Needs ReviewPublic

Authored by AndrewLitteken on Jun 11 2021, 12:05 PM.

Details

Reviewers
jroelofs
paquette
Summary

When the initial relationship between two pairs of values between similar sections is ambiguous to commutativity, arguments to the outlined functions can be passed in such that the order is incorrect, causing miscompilations. This adds a canonical mapping to each similarity section, so that we can maintain the relationship of global value numbering from one section to another.

Added Tests:
Transforms/IROutliner/outlining-commutative-operands-opposite-order.ll
unittests/Analysis/IRSimilarityIdentifierTest.cpp - IRSimilarityCandidate:CanonicalNumbering

Diff Detail

Unit TestsFailed

TimeTest
164,890 msx64 debian > AddressSanitizer-x86_64-linux-dynamic.TestCases/Linux::uar_signals.cpp
Script: -- : 'RUN: at line 3'; /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 -shared-libasan -std=c++11 -O1 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/uar_signals.cpp.tmp -pthread && /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/uar_signals.cpp.tmp