summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorzhongyunde 00443407 <zhongyunde@huawei.com>2023-09-01 23:05:45 -0400
committerZhongyunde <zhongyunde@huawei.com>2023-10-26 19:01:22 +0800
commit5e07481d4240b5e8fd85f9b92df30849606c2af0 (patch)
tree92b4f29fba63aa7c007df4d9d2ffc7d8a6ff91ca /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent925f4622dcd09e0d70c6d30779e0c119fb12ce00 (diff)
[SimplifyCFG] Delete the unnecessary range check for small mask operation
When the small mask value little than 64, we can eliminate the checking for upper limit of the range by enlarge the lookup table size to the maximum index value. (Then the final table size grows to the next pow2 value) ``` bool f(unsigned x) { switch (x % 8) { case 0: return 1; case 1: return 0; case 2: return 0; case 3: return 1; case 4: return 1; case 5: return 0; case 6: return 1; // This would remove the range check: case 7: return 0; } return 0; } ``` Use WouldFitInRegister instead of fitsInLegalInteger to support more result type beside bool. Fixes https://github.com/llvm/llvm-project/issues/65120 Reviewed By: zmodem, nikic, RKSimon
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions