llvm-project/llvm/test/CodeGen/WebAssembly
Sam Clegg 1b6d879ec1 [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
2020-12-08 18:41:32 -08:00
..
PR40172.ll
PR40267.ll
PR41149.ll
PR41841.ll
add-prototypes-conflict.ll
add-prototypes.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
address-offsets.ll [test] Split some tests which test both static and pic relocation models 2020-12-04 18:11:35 -08:00
aliases.ll [WebAssembly] MC: Fix for data aliases with offsets (getelementptr) 2020-06-17 16:25:50 -07:00
atomic-fence.ll
atomic-fence.mir [WebAssembly] Rename atomic.notify and *.atomic.wait 2020-11-13 12:04:48 -08:00
atomic-mem-consistency.ll
atomic-pic.ll [WebAssembly] Fix code generated for atomic operations in PIC mode 2020-12-08 18:41:32 -08:00
atomic-rmw.ll
bulk-memory.ll
bulk-memory64.ll [WebAssembly] Added 64-bit memory.grow/size/copy/fill 2020-07-06 12:49:50 -07:00
byval.ll OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
call-pic.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
call.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
cfg-stackify-dbg-skip.ll
cfg-stackify-dbg.mir
cfg-stackify-eh.ll [WebAssembly] Fix fixEndsAtEndOfFunction for try-catch 2020-09-08 09:27:40 -07:00
cfg-stackify.ll Reland "[WebAssembly] Eliminate range checks on br_tables" 2020-06-03 14:04:59 -07:00
cfi.ll
clear-cache.ll Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
comparisons-f32.ll
comparisons-f64.ll
comparisons-i32.ll
comparisons-i64.ll
conv-trap.ll
conv.ll
copysign-casts.ll
cpus.ll [WebAssembly] Adding 64-bit versions of all load & store ops. 2020-06-15 08:31:56 -07:00
custom-sections.ll
dbgvalue.ll
dead-vreg.ll
debugtest-opt.ll [WebAssembly] Add int32 DW_OP_WASM_location variant 2020-04-16 16:32:17 -07:00
debugtrap.ll [WebAssembly] Lower llvm.debugtrap properly 2020-06-04 13:25:10 -07:00
divrem-constant.ll
eh-labels.mir Simplify MachineVerifier's block-successor verification. 2020-06-06 22:30:51 -04:00
eh-lsda.ll
exception.ll [test] Split some tests which test both static and pic relocation models 2020-12-04 18:11:35 -08:00
explicit-locals.mir
export-name.ll
f16.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
f32.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
f64.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
fast-isel-br-i1.ll
fast-isel-i24.ll
fast-isel-i256.ll
fast-isel-noreg.ll
fast-isel-pr47040.ll [WebAssembly] Fix FastISel address calculation bug 2020-08-08 15:23:11 -07:00
fast-isel.ll
frem.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
fshl.ll [SelectionDAG] Handle non-power-of-2 bitwidths in expandROT 2020-08-26 09:20:46 +01:00
func.ll
function-bitcasts-varargs.ll
function-bitcasts.ll [WebAssembly] Rename Emscripten EH functions 2020-10-07 09:42:49 -07:00
function-info.mir
function-pointer64.ll Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930). 2020-11-18 13:08:46 +03:00
global.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
global_dtors.ll
globl.ll
i32-load-store-alignment.ll
i32.ll
i64-load-store-alignment.ll
i64.ll
i128-returned.ll
i128.ll
ident.ll
immediates.ll
implicit-def.ll
import-module.ll
indirect-import.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
indirectbr.ll [WebAssembly] Make BR_TABLE non-duplicable 2020-06-11 15:11:45 -07:00
inline-asm-m.ll
inline-asm-roundtrip.ll
inline-asm.ll [WebAssembly] Support fp reg class in r constraint 2020-11-18 17:05:58 -08:00
inlineasm-output-template.ll
irreducible-cfg-exceptions.ll
irreducible-cfg.ll
irreducible-cfg.mir
legalize.ll
libcalls.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
lit.local.cfg
llround-conv-i32.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
load-ext-atomic.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
load-ext.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
load-store-i1.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
load-store-pic.ll [TargetMachine] Delete wasm special case from shouldAssumeDSOLocal 2020-12-04 23:22:47 -08:00
load-store-static.ll [TargetMachine] Delete wasm special case from shouldAssumeDSOLocal 2020-12-04 23:22:47 -08:00
load.ll [WebAssembly] Adding 64-bit versions of all load & store ops. 2020-06-15 08:31:56 -07:00
lower-em-ehsjlj-multi-return.ll [WebAssembly] Rename Emscripten EH functions 2020-10-07 09:42:49 -07:00
lower-em-ehsjlj-options.ll [WebAssembly] Rename Emscripten EH functions 2020-10-07 09:42:49 -07:00
lower-em-exceptions-allowed.ll [Target] As part of using inclusive language within the llvm project, 2020-06-20 00:06:39 -07:00
lower-em-exceptions-resume-only.ll [WebAssembly] Fix resume-only case in Emscripten EH 2020-01-23 18:13:52 -08:00
lower-em-exceptions.ll [WebAssembly] Check features before making SjLj vars thread-local 2020-09-25 11:45:16 -07:00
lower-em-sjlj-alias.ll
lower-em-sjlj-debuginfo.ll [WebAssembly] Use dummy debug info in Emscripten SjLj 2020-04-09 18:44:50 -07:00
lower-em-sjlj-sret.ll [WebAssembly] Rename Emscripten EH functions 2020-10-07 09:42:49 -07:00
lower-em-sjlj.ll [WebAssembly] Handle indirect uses of longjmp 2020-10-08 11:37:19 -07:00
lower-global-dtors.ll [WebAssembly] Fix the order of destructors in the LowerGlobalDtors pass. 2020-03-26 16:19:02 -07:00
main-declaration.ll
main-no-args.ll
main-three-args.ll
main-with-args.ll
mem-intrinsics.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
memory-addr32.ll
memory-addr64.ll [WebAssembly] Added 64-bit memory.grow/size/copy/fill 2020-07-06 12:49:50 -07:00
muloti4.ll
multi-return.ll [WebAssembly] Track frame registers through VReg and local allocation 2020-01-17 17:23:56 -08:00
multivalue-stackify.ll [WebAssembly] Fix RegStackify and ExplicitLocals to handle multivalue 2020-02-18 14:56:09 -08:00
multivalue-stackify.py [WebAssembly] Fix RegStackify and ExplicitLocals to handle multivalue 2020-02-18 14:56:09 -08:00
multivalue.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
mutable-globals.ll
negative-base-reg.ll
null-streamer.ll
offset-atomics.ll [WebAssembly] Fix code generated for atomic operations in PIC mode 2020-12-08 18:41:32 -08:00
offset-fastisel.ll
offset-folding.ll [test] Add explicit dso_local to constant/global variable declarations 2020-12-04 13:51:01 -08:00
offset.ll [SelectionDAGBuilder] Stop setting alignment to one for hidden sret values 2020-05-04 14:44:39 +01:00
phi.ll
pr47375.ll [WebAssembly] Fix incorrect assumption of simple value types 2020-09-06 15:42:21 -07:00
reference-types.ll [WebAssembly] Add reference types target feature 2020-01-24 14:26:27 -08:00
reg-argument.mir
reg-copy.mir
reg-stackify.ll [DAGCombiner] Rebuild (setcc x, y, ==) from (xor (xor x, y), 1) 2020-07-15 07:34:22 +00:00
return-address-emscripten.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
return-address-unknown.ll
return-int32.ll
return-void.ll
returned.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
select.ll
signext-arg.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
signext-inreg.ll
signext-zeroext.ll
simd-arith.ll [WebAssembly] Prefer v128.const for constant splats 2020-07-10 18:27:52 -07:00
simd-bitcasts.ll [WebAssembly] Enable recently implemented SIMD operations 2020-02-04 18:36:32 -08:00
simd-build-pair.ll [WebAssembly] Enable recently implemented SIMD operations 2020-02-04 18:36:32 -08:00
simd-build-vector.ll Reland "[WebAssembly] Emulate v128.const efficiently"" 2020-10-13 04:36:59 +00:00
simd-comparisons.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
simd-conversions.ll [WebAssembly] Renumber SIMD opcodes 2020-05-01 17:20:49 -07:00
simd-extended-extract.ll [WebAssembly] Enable recently implemented SIMD operations 2020-02-04 18:36:32 -08:00
simd-illegal-signext.ll
simd-intrinsics.ll [WebAssembly] Prototype i64x2.bitmask 2020-10-30 17:23:30 -07:00
simd-load-lane-offset.ll Reland "[WebAssembly] v128.load{8,16,32,64}_lane instructions" 2020-10-15 19:32:34 +00:00
simd-load-splat.ll
simd-load-store-alignment.ll [NFC][WebAssembly] Add tests for alignment on new SIMD loads 2020-06-09 13:46:12 -07:00
simd-load-zero-offset.ll [WebAssembly] Implement prototype v128.load{32,64}_zero instructions 2020-08-03 13:54:00 -07:00
simd-nested-shuffles.ll
simd-nonconst-sext.ll [WebAssembly] Fix ISel crash in SIGN_EXTEND_INREG lowering 2020-06-03 15:36:44 -07:00
simd-noopt.ll
simd-offset.ll [WebAssembly] Implement truncating vector stores 2020-07-28 17:46:45 -07:00
simd-reductions.ll
simd-scalar-to-vector.ll [WebAssembly] Enable recently implemented SIMD operations 2020-02-04 18:36:32 -08:00
simd-select.ll [WebAssembly] Implement v128.select 2020-07-16 11:37:25 -07:00
simd-sext-inreg.ll [WebAssembly] Simplify extract_vector lowering 2020-02-25 13:54:48 -08:00
simd-shift-complex-splats.ll [WebAssembly][NFC] Simplify vector shift lowering and add tests 2020-07-10 00:18:59 -07:00
simd-shuffle-bitcast.ll [NFC] Fix typo in triples from unkown to unknown 2020-07-02 16:21:54 +08:00
simd-unsupported.ll [WebAssembly] Implement i64x2.mul and remove i8x16.mul 2020-05-19 12:50:44 -07:00
simd-widening.ll [WebAssembly] Remove intrinsics for SIMD widening ops 2020-07-28 18:25:55 -07:00
simd.ll [WebAssembly] Prefer v128.const for constant splats 2020-07-10 18:27:52 -07:00
stack-alignment.ll [WebAssembly] Adding 64-bit versions of __stack_pointer and other globals 2020-06-25 15:52:44 -07:00
stack-insts.ll Reland "[WebAssembly] Eliminate range checks on br_tables" 2020-06-03 14:04:59 -07:00
stack-protector.ll [WebAssembly] Generate unreachable after __stack_chk_fail 2020-07-08 01:02:05 -07:00
stackified-debug.ll [WebAssembly] Added Debug Fixup pass 2020-05-14 13:14:45 -07:00
store-trunc-atomic.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
store-trunc.ll [WebAssembly] Remove unused FileCheck test prefixes 2020-10-29 13:37:55 -07:00
store.ll [WebAssembly] Adding 64-bit versions of all load & store ops. 2020-06-15 08:31:56 -07:00
swiftcc.ll [WebAssembly] Support swiftself and swifterror for WebAssembly target 2020-03-19 17:39:52 -07:00
switch-in-loop.ll [WebAssembly] Make BR_TABLE non-duplicable 2020-06-11 15:11:45 -07:00
switch-unreachable-default.ll [WebAssembly] Fix bug in FixBrTables and use branch analysis utils 2020-06-17 12:34:45 -07:00
switch.ll [WebAssembly] Fixed 64-bit indices in br_table 2020-07-30 10:52:16 -07:00
tailcall.ll OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
target-features-tls.ll [WebAssembly] Disallow 'shared-mem' rather than 'atomics' 2020-05-08 13:52:39 -07:00
target-features.ll [WebAssembly] Update bleeding-edge CPU features 2020-01-24 14:27:35 -08:00
tls-general-dynamic.ll [WebAssembly] Add new relocation type for TLS data symbols 2020-11-13 07:59:29 -08:00
tls-local-exec.ll [WebAssembly] Add new relocation type for TLS data symbols 2020-11-13 07:59:29 -08:00
umulo-128-legalisation-lowering.ll
umulo-i64.ll
unreachable.ll
unsupported-function-bitcasts.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
unused-argument.ll [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
userstack.ll [WebAssembly] Don't fold frame offset for global addresses 2020-11-03 14:56:25 -08:00
varargs.ll
vector-sdiv.ll
vtable.ll
wasmehprepare.ll [WebAssembly] Fix wasm.lsda() optimization in WasmEHPrepare 2020-04-04 07:02:50 -07:00
weak.ll [lld][WebAssembly] Convert more tests to asm format. NFC. 2020-11-19 16:57:00 -08:00