summaryrefslogtreecommitdiff
path: root/include/llvm/Target
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-10-30 11:23:25 +0000
committerHans Wennborg <hans@hanshq.net>2012-10-30 11:23:25 +0000
commit04d7d13d301df66f6c232e41611145c062183bf3 (patch)
tree506f923fd1e30024c1b3be9b63fcdb46f52d1f1b /include/llvm/Target
parentc588e0e162fa08c81558871fb0c50fb51569afe3 (diff)
downloadllvm-04d7d13d301df66f6c232e41611145c062183bf3.tar.gz
llvm-04d7d13d301df66f6c232e41611145c062183bf3.tar.bz2
llvm-04d7d13d301df66f6c232e41611145c062183bf3.tar.xz
Use TargetTransformInfo to control switch-to-lookup table transformation
When the switch-to-lookup tables transform landed in SimplifyCFG, it was pointed out that this could be inappropriate for some targets. Since there was no way at the time for the pass to know anything about the target, an awkward reverse-transform was added in CodeGenPrepare that turned lookup tables back into switches for some targets. This patch uses the new TargetTransformInfo to determine if a switch should be transformed, and removes CodeGenPrepare::ConvertLoadToSwitch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r--include/llvm/Target/TargetTransformImpl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetTransformImpl.h b/include/llvm/Target/TargetTransformImpl.h
index fd4b737afd..fa1acbea08 100644
--- a/include/llvm/Target/TargetTransformImpl.h
+++ b/include/llvm/Target/TargetTransformImpl.h
@@ -46,6 +46,8 @@ public:
virtual unsigned getJumpBufAlignment() const;
virtual unsigned getJumpBufSize() const;
+
+ virtual bool shouldBuildLookupTables() const;
};
class VectorTargetTransformImpl : public VectorTargetTransformInfo {