aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-02-12 14:17:24 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-02-12 14:17:24 +0000
commitb08862c4f0685023dd05ffc3c756aa6a5b50b049 (patch)
tree019535b463db880b699bd7fe68e653472a489b94 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentfe412882c23fca8424057437c57120f681019543 (diff)
downloadllvm-b08862c4f0685023dd05ffc3c756aa6a5b50b049.zip
llvm-b08862c4f0685023dd05ffc3c756aa6a5b50b049.tar.gz
llvm-b08862c4f0685023dd05ffc3c756aa6a5b50b049.tar.bz2
[TTI] Teach the cost heuristic how to query TLI to check if a zext/trunc is 'free' for the target.
Now that SimplifyCFG uses TTI for the cost heuristic, we can teach BasicTTIImpl how to query TLI in order to get a more accurate cost for truncates and zero-extends. Before this patch, the basic cost heuristic in TargetTransformInfoImplCRTPBase would have conservatively returned a 'default' TCC_Basic for all zero-extends, and TCC_Free for truncates on native types. This patch improves the heuristic so that we query TLI (if available) to get more accurate answers. If TLI is available, then methods 'isZExtFree' and 'isTruncateFree' can be used to check if a zext/trunc is free for the target. Added more test cases to SimplifyCFG/X86/speculate-cttz-ctlz.ll. With this change, SimplifyCFG is now able to speculate a 'cheap' cttz/ctlz immediately followed by a free zext/trunc. Differential Revision: http://reviews.llvm.org/D7585 llvm-svn: 228923
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions