aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-12-06 21:13:55 -0800
committerSam Clegg <sbc@chromium.org>2020-12-08 18:41:32 -0800
commit1b6d879ec1fc4e883d0f1f580bbe9230215d9e80 (patch)
tree6cbae29420548429d1fc47d15e983da16b64a9d6 /clang/unittests/Frontend/CompilerInvocationTest.cpp
parent5da71a4274acb86d31b74b79490cab30ac96bbf3 (diff)
downloadllvm-1b6d879ec1fc4e883d0f1f580bbe9230215d9e80.zip
llvm-1b6d879ec1fc4e883d0f1f580bbe9230215d9e80.tar.gz
llvm-1b6d879ec1fc4e883d0f1f580bbe9230215d9e80.tar.bz2
[WebAssembly] Fix code generated for atomic operations in PIC mode
The main this this test does is to add the `IsNotPIC` predicate to the all the atomic instructions pattern that directly refer to `tglobaladdr`. This is because in PIC mode we need to generate separate instruction sequence (either a direct global.get, or __memory_base + offset) for accessing global addresses. As part of this change I noticed that many of the `Requires` attributes added to the instruction in `WebAssemblyInstrAtomics.td` were being honored. This is because the wrapped in a `let Predicates = [HasAtomics]` block and it seems that that outer wrapping overrides any `Requires` on defs within it. As a workaround I removed the outer `let` and added `HasAtomics` to all the inner `Requires`. I believe that all the instrucitons that don't have `Requires` explicit bottom out in `ATOMIC_I` and `ATOMIC_NRI` which have `HasAtomics` so this should not remove this predicate from any patterns (at least that is the idea). The alternative to this approach looks like implementing something like `PredicateControl` in `Mips.td` where we can split the predicates into groups so they don't clobber each other. Differential Revision: https://reviews.llvm.org/D92744
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
0 files changed, 0 insertions, 0 deletions