[opt] Fix run-twice option for non-idempotent passes
authorKeno Fischer <kfischer@college.harvard.edu>
Sat, 5 Dec 2015 01:38:12 +0000 (01:38 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Sat, 5 Dec 2015 01:38:12 +0000 (01:38 +0000)
commit3687382a3485127a701ef31dabed4a32cf231276
tree859a32361a0c0c79767ec443fdbf7ddbe483a9fd
parent517455ae01552736121c387b27362e2f0244de7e
[opt] Fix run-twice option for non-idempotent passes

Cloning the module was supposed to guard against the possibility
that the passes may be non-idempotent. However, for some reason
I decided to put that AFTER the passes had already run on the
module, defeating the point entirely. Fix that by moving up the
CloneModule as is done in llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254819 91177308-0d34-0410-b5e6-96231b3b80d8
tools/opt/opt.cpp