diff options
author | Dipesh Sharma <76941383+dipeshs809@users.noreply.github.com> | 2025-06-23 14:20:28 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-23 09:50:28 +0100 |
commit | bc6faf9a020880f2902581a898e4434000d263f7 (patch) | |
tree | 7315543abee12745264b733db675706080c68d2b /lldb/packages/Python/lldbsuite/test/configuration.py | |
parent | be000986322ebb796ec7127629a865897dede966 (diff) | |
download | llvm-bc6faf9a020880f2902581a898e4434000d263f7.zip llvm-bc6faf9a020880f2902581a898e4434000d263f7.tar.gz llvm-bc6faf9a020880f2902581a898e4434000d263f7.tar.bz2 |
[X86] X86LegalizerInfo - use LegalFor instead if LegalIf for simple ISA/test pairs (#144675)
We have lots of `legalIf to` evaluate the legality of instructions based
on predicate's truthfulness, which should be simplified to use the
`legalFor({Types})` or `legalFor(Pred, {Types})` helpers:
closes #138259
for eg:
```
getActionDefinitionsBuilder({G_ADD, G_SUB})
.legalIf([=](const LegalityQuery &Query) -> bool {
if (typeInSet(0, {s8, s16, s32})(Query))
return true;
if (Is64Bit && typeInSet(0, {s64})(Query))
return true;
if (HasSSE2 && typeInSet(0, {v16s8, v8s16, v4s32, v2s64})(Query))
return true;
if (HasAVX2 && typeInSet(0, {v32s8, v16s16, v8s32, v4s64})(Query))
return true;
if (HasAVX512 && typeInSet(0, {v16s32, v8s64})(Query))
return true;
if (HasBWI && typeInSet(0, {v64s8, v32s16})(Query))
return true;
return false;
})
```
gets transformed to:
```
getActionDefinitionsBuilder({G_ADD, G_SUB})
.legalFor({s8, s16, s32})
.legalFor(Is64Bit, {s64})
.legalFor(HasSSE2, {v16s8, v8s16, v4s32, v2s64})
--- etc ---
```
---------
Co-authored-by: Simon Pilgrim <llvm-dev@redking.me.uk>
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
0 files changed, 0 insertions, 0 deletions