|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | DICompositeType will have an identifier field at position 14. For now, the
field is set to null in DIBuilder.
For DICompositeTypes where the template argument field (the 13th field)
was optional, modify DIBuilder to make sure the template argument field is set.
Now DICompositeType has 15 fields.
Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode.
Update verifier to check that DICompositeType has 15 fields and the last
field is null or a MDString.
Update testing cases to include an extra field for DICompositeType.
The identifier field will be used by type uniquing so a front end can
genearte a DICompositeType with a unique identifer.
llvm-svn: 189282 | 
| | 
| 
| 
| | llvm-svn: 188926 | 
| | 
| 
| 
| | llvm-svn: 188919 | 
| | 
| 
| 
| | llvm-svn: 188917 | 
| | 
| 
| 
| | llvm-svn: 188831 | 
| | 
| 
| 
| | llvm-svn: 188721 | 
| | 
| 
| 
| 
| 
| 
| 
| | Also fix it calculating the wrong value. The struct index
is not a ConstantInt, so it was being interpreted as an array
index.
llvm-svn: 188713 | 
| | 
| 
| 
| 
| 
| | Re-add the inboundsless tests I didn't add originally
llvm-svn: 188710 | 
| | 
| 
| 
| 
| 
| 
| | * pow(x, 0.5) -> fabs(sqrt(x)) 
* pow(2.0, x) -> exp2(x)
llvm-svn: 188656 | 
| | 
| 
| 
| | llvm-svn: 188529 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).
 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).
 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.
llvm-svn: 188513 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | When both constants are positive or both constants are negative,
InstCombine already simplifies comparisons like this, but when
it's exactly zero and -1, the operand sorting ends up reversed
and the pattern fails to match. Handle that special case.
Follow up for rdar://14689217
llvm-svn: 188512 | 
| | 
| 
| 
| 
| 
| 
| | This path wasn't tested before without a datalayout,
so add some more tests and re-run with and without one.
llvm-svn: 188507 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | the input character is not converted to char before comparing with zero.
The patch was discussed in this thread:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130812/184069.html
llvm-svn: 188489 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Use the pointer size if datalayout is available.
Use i64 if it's not, which is consistent with what other
places do when the pointer size is unknown.
The test doesn't really test this in a useful way
since it will be transformed to that later anyway,
but this now tests it for non-zero arrays and when
datalayout isn't available. The cases in
visitGetElementPtrInst should save an extra re-visit to
the newly created GEP since it won't need to cleanup after
itself.
llvm-svn: 188339 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.
Patch by Ron Ofir.
llvm-svn: 188173 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | These functions used to assume that the lsb of an integer corresponds
to vector element 0, whereas for big-endian it's the other way around:
the msb is in the first element and the lsb is in the last element.
Fixes MultiSource/Benchmarks/mediabench/gsm/toast for z.
llvm-svn: 188155 | 
| | 
| 
| 
| | llvm-svn: 187462 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | instructions
Call into ComputeMaskedBits to figure out which bits are set on both add
operands and determine if the value is a power-of-two-or-zero or not.
llvm-svn: 187445 | 
| | 
| 
| 
| 
| 
| 
| 
| | It will now only convert the arguments / return value and call
the underlying function if the types are able to be bitcasted.
This avoids using fp<->int conversions that would occur before.
llvm-svn: 187444 | 
| | 
| 
| 
| | llvm-svn: 187362 | 
| | 
| 
| 
| 
| 
| 
| 
| | Also always add DIType, DISubprogram and DIGlobalVariable to the list
in DebugInfoFinder without checking them, so we can verify them later
on.
llvm-svn: 187285 | 
| | 
| 
| 
| 
| 
| 
| | also worthwhile for it to look through FP extensions and truncations, whose
application commutes with fneg.
llvm-svn: 187249 | 
| | 
| 
| 
| | llvm-svn: 187130 | 
| | 
| 
| 
| 
| 
| | deallocation functions.
llvm-svn: 186798 | 
| | 
| 
| 
| | llvm-svn: 186759 | 
| | 
| 
| 
| | llvm-svn: 186533 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | easier debugging. No functionality change.
This conversion was done with the following bash script:
  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)define\([^@]*\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3define\4@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done
llvm-svn: 186269 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | functionality change.
This update was done with the following bash script:
  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done
llvm-svn: 186268 | 
| | 
| 
| 
| 
| 
| 
| 
| | some cases, rather than just a common prefix. No functionality change.
(This is to avoid confusing a scripted mass update of these tests to use CHECK-LABEL)
llvm-svn: 186267 | 
| | 
| 
| 
| | llvm-svn: 186263 | 
| | 
| 
| 
| | llvm-svn: 186235 | 
| | 
| 
| 
| 
| 
| 
| 
| | undef vector of the wrong type.
LGTM'd by Nick Lewycky on IRC.
llvm-svn: 186224 | 
| | 
| 
| 
| | llvm-svn: 185973 | 
| | 
| 
| 
| 
| 
| 
| | (add nsw x, (and x, y)) isn't a power of two if x is zero, it's zero
(add nsw x, (xor x, y)) isn't a power of two if y has bits set that aren't set in x
llvm-svn: 185954 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | The following transforms are valid if -C is a power of 2:
(icmp ugt (xor X, C), ~C) -> (icmp ult X, C)
(icmp ult (xor X, C), -C) -> (icmp uge X, C)
These are nice, they get rid of the xor.
llvm-svn: 185915 | 
| | 
| 
| 
| 
| 
| | Tests were added in r185910 somehow.
llvm-svn: 185912 | 
| | 
| 
| 
| | llvm-svn: 185910 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | C1-X <u C2 -> (X|(C2-1)) == C1
C1-X >u C2 -> (X|C2) == C1
X-C1 <u C2 -> (X & -C2) == C1
X-C1 >u C2 -> (X & ~C2) == C1
llvm-svn: 185909 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Back in r179493 we determined that two transforms collided with each
other.  The fix back then was to reorder the transforms so that the
preferred transform would give it a try and then we would try the
secondary transform.  However, it was noted that the best approach would
canonicalize one transform into the other, removing the collision and
allowing us to optimize IR given to us in that form.
llvm-svn: 185808 | 
| | 
| 
| 
| | llvm-svn: 185737 | 
| | 
| 
| 
| 
| 
| 
| | functions. Make the function attributes pass add it to known library functions
and when it can deduce it.
llvm-svn: 185735 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This transform allows us to turn IR that looks like:
  %1 = icmp eq i64 %b, 0
  %2 = icmp ult i64 %a, %b
  %3 = or i1 %1, %2
  ret i1 %3
into:
  %0 = add i64 %b, -1
  %1 = icmp uge i64 %0, %a
  ret i1 %1
which means we go from lowering:
        cmpq    %rsi, %rdi
        setb    %cl
        testq   %rsi, %rsi
        sete    %al
        orb     %cl, %al
        ret
to lowering:
        decq    %rsi
        cmpq    %rdi, %rsi
        setae   %al
        ret
llvm-svn: 185677 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This transform was originally added in r185257 but later removed in
r185415.  The original transform would create instructions speculatively
and then discard them if the speculation was proved incorrect.  This has
been replaced with a scheme that splits the transform into two parts:
preflight and fold.  While we preflight, we build up fold actions that
inform the folding stage on how to act.
llvm-svn: 185667 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 'select' denoms)
I'm reverting this commit because:
 1. As discussed during review, it needs to be rewritten (to avoid creating and
then deleting instructions).
 2. This is causing optimizer crashes. Specifically, I'm seeing things like
this:
    While deleting: i1 %
    Use still stuck around after Def is destroyed:  <badref> = select i1 <badref>, i32 0, i32 1
    opt: /src/llvm-trunk/lib/IR/Value.cpp:79: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.
   I'd guess that these will go away once we're no longer creating/deleting
instructions here, but just in case, I'm adding a regression test.
Because the code is bring rewritten, I've just XFAIL'd the original regression test. Original commit message:
	InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms
	Real world code sometimes has the denominator of a 'udiv' be a
	'select'.  LLVM can handle such cases but only when the 'select'
	operands are symmetric in structure (both select operands are a constant
	power of two or a left shift, etc.).  This falls apart if we are dealt a
	'udiv' where the code is not symetric or if the select operands lead us
	to more select instructions.
	Instead, we should treat the LHS and each select operand as a distinct
	divide operation and try to optimize them independently.  If we can
	to simplify each operation, then we can replace the 'udiv' with, say, a
	'lshr' that has a new select with a bunch of new operands for the
	select.
llvm-svn: 185415 | 
| | 
| 
| 
| 
| 
| 
| 
| | trying to remove a sext from a compare.
Fixes PR16462.
llvm-svn: 185284 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | X is a power of two
This allows us to simplify urem instructions involving the add+xor to
turn into simpler math.
llvm-svn: 185272 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | don't match.
Inserting a zext or trunc is sufficient. This pattern is somewhat common in
LLVM's pointer mangling code.
llvm-svn: 185270 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Changing the sign when comparing the base pointer would introduce all
sorts of unexpected things like:
  %gep.i = getelementptr inbounds [1 x i8]* %a, i32 0, i32 0
  %gep2.i = getelementptr inbounds [1 x i8]* %b, i32 0, i32 0
  %cmp.i = icmp ult i8* %gep.i, %gep2.i
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = icmp ne i1 %cmp.i, %cmp.i1
  ret i1 %cmp
into:
  %cmp.i = icmp slt [1 x i8]* %a, %b
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = xor i1 %cmp.i, %cmp.i1
  ret i1 %cmp
By preserving the original sign, we now get:
  ret i1 false
This fixes PR16483.
llvm-svn: 185259 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Real world code sometimes has the denominator of a 'udiv' be a
'select'.  LLVM can handle such cases but only when the 'select'
operands are symmetric in structure (both select operands are a constant
power of two or a left shift, etc.).  This falls apart if we are dealt a
'udiv' where the code is not symetric or if the select operands lead us
to more select instructions.
Instead, we should treat the LHS and each select operand as a distinct
divide operation and try to optimize them independently.  If we can
to simplify each operation, then we can replace the 'udiv' with, say, a
'lshr' that has a new select with a bunch of new operands for the
select.
llvm-svn: 185257 |