MCPcopy Create free account
hub / github.com/GoSSIP-SJTU/Armariris / reuseTableCompare

Function reuseTableCompare

lib/Transforms/Utils/SimplifyCFG.cpp:4749–4811  ·  view source on GitHub ↗

Try to reuse the switch table index compare. Following pattern: \code if (idx < tablesize) r = table[idx]; // table does not contain default_value else r = default_value; if (r != default_value) ... \endcode Is optimized to: \code cond = idx < tablesize; if (cond) r = table[idx]; else r = default_value; if (cond) ... \endcode Jump threading will then eliminate the second if(cond).

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

SwitchToLookupTableFunction · 0.85

Calls 13

getTrueFunction · 0.85
getFalseFunction · 0.85
assertFunction · 0.50
pred_beginFunction · 0.50
pred_endFunction · 0.50
getFunction · 0.50
getParentMethod · 0.45
getOperandMethod · 0.45
getConditionMethod · 0.45
getTypeMethod · 0.45
getPredicateMethod · 0.45
getUniquePredecessorMethod · 0.45

Tested by

no test coverage detected