|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| | multiple users.
llvm-svn: 73656 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | move loads back past a check that the load address
is valid, see new testcase.  The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer.  It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.
llvm-svn: 73632 | 
| | 
| 
| 
| | llvm-svn: 73625 | 
| | 
| 
| 
| | llvm-svn: 73621 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | >>     
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken.  I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>   
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.
assert(New->getType() == getType() &&
        "replaceAllUses of value with new value of different type!");
Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have  a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking
GV->getType()->getAddressSpace() == 0. 
llvm-svn: 73605 | 
| | 
| 
| 
| 
| 
| | SRem.
llvm-svn: 73598 | 
| | 
| 
| 
| | llvm-svn: 73541 | 
| | 
| 
| 
| 
| 
| 
| | to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes.  Patch by Frits van Bommel!
llvm-svn: 73506 | 
| | 
| 
| 
| | llvm-svn: 73451 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | failures.
To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.
Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.
llvm-svn: 73431 | 
| | 
| 
| 
| 
| 
| 
| 
| | problem addressed in 31284, but the patch there only
addressed the case where an invoke is the first thing in
a block.
llvm-svn: 73416 | 
| | 
| 
| 
| | llvm-svn: 73412 | 
| | 
| 
| 
| | llvm-svn: 73398 | 
| | 
| 
| 
| | llvm-svn: 73362 | 
| | 
| 
| 
| 
| 
| | SmallVector instead of std::vector.
llvm-svn: 73357 | 
| | 
| 
| 
| | llvm-svn: 73355 | 
| | 
| 
| 
| | llvm-svn: 73342 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.
This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.
llvm-svn: 73338 | 
| | 
| 
| 
| 
| 
| | pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!
llvm-svn: 73299 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | induction variable when the addrec to be expanded does not require
a wider type. This eliminates the need for IndVarSimplify to
micro-manage SCEV expansions, because SCEVExpander now
automatically expands them in the form that IndVarSimplify considers
to be canonical. (LSR still micro-manages its SCEV expansions,
because it's optimizing for the target, rather than for
other optimizations.)
Also, this uses the new getAnyExtendExpr, which has more clever
expression simplification logic than the IndVarSimplify code it
replaces, and this cleans up some ugly expansions in code such as
the included masked-iv.ll testcase.
llvm-svn: 73294 | 
| | 
| 
| 
| 
| 
| | non-default addrspaces.
llvm-svn: 73253 | 
| | 
| 
| 
| 
| 
| | it may round differently. This fixes PR4374.
llvm-svn: 73243 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.
Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.
llvm-svn: 73241 | 
| | 
| 
| 
| | llvm-svn: 73235 | 
| | 
| 
| 
| | llvm-svn: 73231 | 
| | 
| 
| 
| 
| 
| | thunks.
llvm-svn: 73230 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | points to while analyzing all other fields.
Use FoldingSetNodeID to produce a good hash. This dramatically decreases run
times.
Emit thunks. This means that it can look at all functions regardless of what
the linkage is or if the address is taken, but unfortunately some small
functions can be even shorter than the thunk because our backend doesn't yet
realize it can just turn these into jumps. This means that this pass will
pessimize code on average.
llvm-svn: 73222 | 
| | 
| 
| 
| 
| 
| | turned into unreachable.
llvm-svn: 73195 | 
| | 
| 
| 
| | llvm-svn: 73164 | 
| | 
| 
| 
| 
| 
| 
| | identical function ConstantIsDead() to SafeToDestroyConstant(), to
emphasise the connection with Constant::destroyConstant().
llvm-svn: 73149 | 
| | 
| 
| 
| 
| 
| | Fixes PR4314.
llvm-svn: 73007 | 
| | 
| 
| 
| 
| 
| | sometimes it can find simplifications that won't be found otherwise.
llvm-svn: 73006 | 
| | 
| 
| 
| 
| 
| | Instructions.
llvm-svn: 73002 | 
| | 
| 
| 
| | llvm-svn: 72965 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.
For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.
This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt
llvm-svn: 72897 | 
| | 
| 
| 
| 
| 
| 
| 
| | instcombine doesn't know when it's safe. To partially compensate
for this, introduce new code to do this transformation in
dagcombine, which can use UnsafeFPMath.
llvm-svn: 72872 | 
| | 
| 
| 
| 
| 
| | be simplified to a loop-invariant value. This fixes PR4315.
llvm-svn: 72798 | 
| | 
| 
| 
| 
| 
| 
| | addresses, involving Base values which do not have Pointer type.
This fixes PR4297.
llvm-svn: 72739 | 
| | 
| 
| 
| 
| 
| | can happen when PHI uses are recursively dependent on each other.
llvm-svn: 72710 | 
| | 
| 
| 
| 
| 
| 
| 
| | RewriteStoreUserOfWholeAlloca deal with tail padding because 
isSafeUseOfBitCastedAllocation expects them to.  Otherwise, we crash 
trying to erase the bitcast.
llvm-svn: 72688 | 
| | 
| 
| 
| 
| 
| 
| 
| | a single predecessor.
Patch by Jakub Staszak.
llvm-svn: 72661 | 
| | 
| 
| 
| 
| 
| | Benjamin Kramer!
llvm-svn: 72625 | 
| | 
| 
| 
| | llvm-svn: 72610 | 
| | 
| 
| 
| | llvm-svn: 72589 | 
| | 
| 
| 
| | llvm-svn: 72577 | 
| | 
| 
| 
| 
| 
| | is, otherwise we get a <badref>.
llvm-svn: 72567 | 
| | 
| 
| 
| 
| 
| 
| | This is useful when trying to figure out why GVN didn't eliminate redundant
loads.
llvm-svn: 72565 | 
| | 
| 
| 
| 
| 
| | Diagnosis and patch thanks to Jakub Staszak.
llvm-svn: 72562 | 
| | 
| 
| 
| 
| 
| | empty SmallVector.
llvm-svn: 72512 | 
| | 
| 
| 
| 
| 
| 
| 
| | rewrite the comparison if there is any implicit extension or truncation
on the induction variable. I'm planning for IVUsers to eventually take
over some of the work of this code, and for it to be generalized.
llvm-svn: 72496 |