[TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functio...