summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
diff options
context:
space:
mode:
authorAditya Nandakumar <aditya_nandakumar@apple.com>2017-11-14 22:42:19 +0000
committerAditya Nandakumar <aditya_nandakumar@apple.com>2017-11-14 22:42:19 +0000
commite6201c8724dbce94969bc0b7f81e950cdbb6f742 (patch)
tree47d84fb93d8b988fb473302eee994a83c24481ad /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
parent88e6e189164f0c4bf7d8b29d7a27ef9ae39ef3a9 (diff)
downloadbcm5719-llvm-e6201c8724dbce94969bc0b7f81e950cdbb6f742.tar.gz
bcm5719-llvm-e6201c8724dbce94969bc0b7f81e950cdbb6f742.zip
[GISel]: Rework legalization algorithm for better elimination of
artifacts along with DCE Legalization Artifacts are all those insts that are there to make the type system happy. Currently, the target needs to say all combinations of extends and truncs are legal and there's no way of verifying that post legalization, we only have *truly* legal instructions. This patch changes roughly the legalization algorithm to process all illegal insts at one go, and then process all truncs/extends that were added to satisfy the type constraints separately trying to combine trivial cases until they converge. This has the added benefit that, the target legalizerinfo can only say which truncs and extends are okay and the artifact combiner would combine away other exts and truncs. Updated legalization algorithm to roughly the following pseudo code. WorkList Insts, Artifacts; collect_all_insts_and_artifacts(Insts, Artifacts); do { for (Inst in Insts) legalizeInstrStep(Inst, Insts, Artifacts); for (Artifact in Artifacts) tryCombineArtifact(Artifact, Insts, Artifacts); } while(!Insts.empty()); Also, wrote a simple wrapper equivalent to SetVector, except for erasing, it avoids moving all elements over by one and instead just nulls them out. llvm-svn: 318210
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud