| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
with different sizes.
llvm-svn: 167018
|
| |
|
|
|
|
| |
This fixes Clang :: CodeGen/complex-builtints.c on PowerPC.
llvm-svn: 167013
|
| |
|
|
| |
llvm-svn: 166607
|
| |
|
|
|
|
|
|
|
| |
address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.
llvm-svn: 166578
|
| |
|
|
| |
llvm-svn: 166475
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
%V = mul i64 %N, 4
%t = getelementptr i8* bitcast (i32* %arr to i8*), i32 %V
into
%t1 = getelementptr i32* %arr, i32 %N
%t = bitcast i32* %t1 to i8*
incorporating the multiplication into the getelementptr.
This happens all the time in dragonegg, for example for
int foo(int *A, int N) {
return A[N];
}
because gcc turns this into byte pointer arithmetic before it hits the plugin:
D.1590_2 = (long unsigned int) N_1(D);
D.1591_3 = D.1590_2 * 4;
D.1592_5 = A_4(D) + D.1591_3;
D.1589_6 = *D.1592_5;
return D.1589_6;
The D.1592_5 line is a POINTER_PLUS_EXPR, which is turned into a getelementptr
on a bitcast of A_4 to i8*, so this becomes exactly the kind of IR that the
transform fires on.
An analogous transform (with no testcases!) already existed for bitcasts of
arrays, so I rewrote it to share code with this one.
llvm-svn: 166474
|
| |
|
|
|
|
|
|
| |
ConstantFoldInstOperands and crash.
Have to refactor the ConstantFolder interface one day to define bugs like this away. Fixes PR14131.
llvm-svn: 166374
|
| |
|
|
|
|
|
|
|
|
|
|
| |
An obfuscated splat is where the frontend poorly generates code for a splat
using several different shuffles to create the splat, i.e.,
%A = load <4 x float>* %in_ptr, align 16
%B = shufflevector <4 x float> %A, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
%C = shufflevector <4 x float> %B, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 4, i32 undef>
%D = shufflevector <4 x float> %C, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
llvm-svn: 166061
|
| |
|
|
|
|
| |
own class named AttrBuilder. No functionality change.
llvm-svn: 165960
|
| |
|
|
|
|
| |
different pointer sizes on a per address space basis.
llvm-svn: 165941
|
| |
|
|
|
|
| |
This gets rid of some magic numbers.
llvm-svn: 165924
|
| |
|
|
|
|
|
|
|
|
| |
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.
llvm-svn: 165917
|
| |
|
|
| |
llvm-svn: 165899
|
| |
|
|
|
|
| |
the equivalent from the builder class.
llvm-svn: 165896
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the new LibCallSimplifier class as outlined in [1].
In addition to providing the new base library simplification infrastructure,
all the fortified library call simplifications were moved over to the new
infrastructure. The rest of the library simplification optimizations will
be moved over with follow up patches.
NOTE: The original fortified library call simplifier located in the
SimplifyFortifiedLibCalls class was not removed because it is still
used by CodeGenPrepare. This class will eventually go away too.
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052283.html
llvm-svn: 165873
|
| |
|
|
| |
llvm-svn: 165747
|
| |
|
|
|
|
| |
per address space pointer sizes to be optimized correctly.
llvm-svn: 165726
|
| |
|
|
| |
llvm-svn: 165693
|
| |
|
|
|
|
|
| |
We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.
llvm-svn: 165488
|
| |
|
|
| |
llvm-svn: 165465
|
| |
|
|
| |
llvm-svn: 165402
|
| |
|
|
| |
llvm-svn: 164814
|
| |
|
|
|
|
| |
See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
|
| |
|
|
| |
llvm-svn: 164767
|
| |
|
|
| |
llvm-svn: 164763
|
| |
|
|
| |
llvm-svn: 164629
|
| |
|
|
|
|
| |
This avoids a crash in visitAllocaInst when target data isn't available.
llvm-svn: 164539
|
| |
|
|
|
|
|
|
| |
a value that is zext'd.
Fixes PR13250.
llvm-svn: 164377
|
| |
|
|
| |
llvm-svn: 164117
|
| |
|
|
| |
llvm-svn: 163974
|
| |
|
|
|
|
| |
loads and stores.
llvm-svn: 163844
|
| |
|
|
| |
llvm-svn: 163817
|
| |
|
|
| |
llvm-svn: 162911
|
| |
|
|
|
|
|
|
| |
because C always rounds towards zero.
Thanks Dirk and Ben.
llvm-svn: 162899
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This disables malloc-specific optimization when -fno-builtin (or -ffreestanding)
is specified. This has been a problem for a long time but became more severe
with the recent memory builtin improvements.
Since the memory builtin functions are used everywhere, this required passing
TLI in many places. This means that functions that now have an optional TLI
argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead
mallocs anymore if the TLI argument is missing. I've updated most passes to do
the right thing.
Fixes PR13694 and probably others.
llvm-svn: 162841
|
| |
|
|
|
|
|
|
|
| |
the bit width.
No test case, undefined shifts get folded early, but can occur when other
transforms generate a constant. Thanks to Duncan for bringing this up.
llvm-svn: 162755
|
| |
|
|
|
|
| |
and non-const shifts.
llvm-svn: 162751
|
| |
|
|
|
|
| |
Thanks Benjamin for noticing this.
llvm-svn: 162749
|
| |
|
|
|
|
|
|
|
|
| |
For example:
%1 = lshr i32 %x, 2
%2 = udiv i32 %1, 100
rdar://12182093
llvm-svn: 162743
|
| |
|
|
|
|
|
|
|
|
| |
This optimization is really just replacing allocas wholesale with
globals, there is no scalarization.
The underlying motivation for this patch is to simplify the SROA pass
and focus it on splitting and promoting allocas.
llvm-svn: 162271
|
| |
|
|
| |
llvm-svn: 162180
|
| |
|
|
|
|
| |
single IR instruction.
llvm-svn: 162175
|
| |
|
|
| |
llvm-svn: 162174
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- memcpy size is wrongly truncated into 32-bit and treat 8GB memcpy is
0-sized memcpy
- as 0-sized memcpy/memset is already removed before SimplifyMemTransfer
and SimplifyMemSet in visitCallInst, replace 0 checking with
assertions.
- replace getZExtValue() with getLimitedValue() according to
Eli Friedman
llvm-svn: 161923
|
| |
|
|
|
|
|
|
|
| |
An unsigned value converted to floating-point will always be greater than
a negative constant. Unfortunately InstCombine reversed the check so that
unsigned values were being optimized to always be greater than all positive
floating-point constants. <rdar://problem/12029145>
llvm-svn: 161452
|
| |
|
|
|
|
|
|
| |
self-referencing select inst.
This can happen as long as the instruction is not reachable. Instcombine does generate these unreachable malformed selects when doing RAUW
llvm-svn: 160874
|
| |
|
|
|
|
| |
vector
llvm-svn: 160835
|
| |
|
|
|
|
| |
their operand
llvm-svn: 160823
|
| |
|
|
|
|
|
|
|
| |
creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.
llvm-svn: 160733
|
| |
|
|
| |
llvm-svn: 160477
|