llvm-6502/lib/Transforms/Scalar
Jingyue Wu 1d56cda023 Partially revert r210444 due to performance regression
Summary:
Converting outermost zext(a) to sext(a) causes worse code when the
computation of zext(a) could be reused. For example, after converting

... = array[zext(a)]
... = array[zext(a) + 1]

to

... = array[sext(a)]
... = array[zext(a) + 1],

the program computes sext(a), which is actually unnecessary. I added one
test in split-gep-and-gvn.ll to illustrate this scenario.

Also, with r211281 and r211084, we annotate more "nuw" tags to
computation involving CUDA intrinsics such as threadIdx.x. These
annotations help with splitting GEP a lot, rendering the benefit we get
from this reverted optimization only marginal.

Test Plan: make check-all

Reviewers: eliben, meheff

Reviewed By: meheff

Subscribers: jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D4542

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213209 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 23:25:00 +00:00
..
ADCE.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
CMakeLists.txt Move GlobalMerge from Transform to CodeGen. 2014-06-13 22:57:59 +00:00
ConstantHoisting.cpp ConstantHoisting.cpp: Add <tuple> for std::tie, since r207593 removed FileSystem.h, it includes <tuple>. 2014-04-30 06:44:50 +00:00
ConstantProp.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
CorrelatedValuePropagation.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
DCE.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
DeadStoreElimination.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
EarlyCSE.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
FlattenCFGPass.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
GVN.cpp GVN: Preserve invariant.load metadata 2014-06-26 19:51:19 +00:00
IndVarSimplify.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
JumpThreading.cpp Fix an issue with the MergeBasicBlockIntoOnlyPred() helper function where it did 2014-07-12 07:12:47 +00:00
LICM.cpp Allow isDereferenceablePointer to look through some bitcasts 2014-07-10 05:27:53 +00:00
LLVMBuild.txt Add proper dependencies to LLVMBuild.txt in llvm/lib. 2013-12-10 05:39:34 +00:00
LoadCombine.cpp Add LoadCombine pass. 2014-05-29 01:55:07 +00:00
LoopDeletion.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
LoopIdiomRecognize.cpp Remove extra whitespace in function declaration. No functionality change. 2014-06-14 03:48:29 +00:00
LoopInstSimplify.cpp RecursivelyDeleteTriviallyDeadInstructions() could remove 2014-04-26 05:58:11 +00:00
LoopRerollPass.cpp Feeding isSafeToSpeculativelyExecute its DataLayout pointer 2014-07-10 14:41:31 +00:00
LoopRotation.cpp Make the LoopRotate pass's maximum header size configurable both programmatically 2014-05-26 08:58:51 +00:00
LoopStrengthReduce.cpp [LSR] Canonicalize reg1 + ... + regN into reg1 + ... + 1*regN. 2014-05-20 19:25:04 +00:00
LoopUnrollPass.cpp Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
LoopUnswitch.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
LowerAtomic.cpp IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
Makefile
MemCpyOptimizer.cpp Don't eliminate memcpy's when the address of the pointer may itself be relevant. Fixes PR18304. Patch by David Wiberg! 2014-07-14 18:52:02 +00:00
PartiallyInlineLibCalls.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
Reassociate.cpp [Reassociate] Similar to "X + -X" -> "0", added code to handle "X + ~X" -> "-1". 2014-05-31 15:01:54 +00:00
Reg2Mem.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
SampleProfile.cpp Update the MemoryBuffer API to use ErrorOr. 2014-07-06 17:43:13 +00:00
Scalar.cpp Move GlobalMerge from Transform to CodeGen. 2014-06-13 22:57:59 +00:00
Scalarizer.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
ScalarReplAggregates.cpp Allow isDereferenceablePointer to look through some bitcasts 2014-07-10 05:27:53 +00:00
SCCP.cpp SCCP: update for cmpxchg returning { iN, i1 } now. 2014-06-13 14:54:09 +00:00
SeparateConstOffsetFromGEP.cpp Partially revert r210444 due to performance regression 2014-07-16 23:25:00 +00:00
SimplifyCFGPass.cpp Remove 'using std::errro_code' from lib. 2014-06-13 02:24:39 +00:00
Sink.cpp Feeding isSafeToSpeculativelyExecute its DataLayout pointer (in Sink) 2014-07-10 16:07:11 +00:00
SROA.cpp Allow isDereferenceablePointer to look through some bitcasts 2014-07-10 05:27:53 +00:00
StructurizeCFG.cpp Use range for 2014-05-19 17:52:48 +00:00
TailRecursionElimination.cpp Add support for missed and analysis optimization remarks. 2014-05-22 14:19:46 +00:00