Can I post a pre-print of my paper on ArXiv knowing the paper will go through major changes? Alternatives?
If you only want people who use your code to read the paper in its present form, then post it on Github with the code. If you want a broader audience of researchers to read it in its present form, post it on arXiv.
Updating it with substantial changes later is not a problem. Contrary to what one of the other posted answers says, the update feature on arXiv is most commonly used to post the author's final version after peer review, which frequently contains major revisions.
I wouldn't post things to ResearchGate; to many (myself included) it is viewed mainly as a source of spam.
ArXiv is a pre-print server. A pre-prints is the version of an article before it is submitted to a scientific journal and will be peer-reviewed. Sometimes it's also called First-Draft or Submission Version. If peer-review ends with major revisions, the pre-print is still the pre-print.
Publishing the post-print, which is the version of the article accepted for publication, is something different than publishing the pre-print. It includes all modifications and revisions of the peer-review process but is not in the journal layout. Sometimes it's also called Final-Draft-Post-Referee(ing) or Authors Fulltext.
Before uploading your pre-print to arXiv you should check whether the journal you chose allows pre-prints on arXiv. If so, go ahead and upload your pre-print.
Before uploading the post-print, e.g. on your personal website or your institutional repository, you should also check the journal guidelines.
In principle, a pre-print can be modified on arXiv: "To replace an article". There is a versioning of the articles but this feature is mainly used for minor corrections as typos.
Edit: Someone mentioned that it is common to upload the post-print as new version to arXiv. I couldn't find a direct statement on arXiv about this but there is a study comparing arXiv articles with their final published versions. The authors found that 35% of all arXiv articles have more than one version and their comparison implies that the latest versions are more close to the final published versions, i.e. there are post-prints on arXiv or the review processes don't modify papers that much. Here is another source confirming post-prints on arXiv to be common. I just couldn't verify the mentioned encouragement to do so.
If you know your paper will be seriously reorganized, it is probably wiser to wait before sending to arXiv. Although it is possible to update papers on arXiv, the site also numbers the versions and also indicates the date of each version.
It is not always advantageous for the reputation of a submission to have several updates or a long delay between submission to arXiv and actual publication in an actual journal (of course details of what is a lengthy delay will depend on the disciplines and subdisciplines.)
There are exceptions, for instance in hot areas where you may need to establish priority. This should be balanced with the possible negative perceptions stated above.