aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2013-05-14Adding a pass - RewritePNaClLibraryCalls, that replaces known library calls ↵Eli Bendersky
with stable bitcode intrinsics. Starting with setjmp and longjmp. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429 R=jvoung@chromium.org, mseaborn@chromium.org Review URL: https://codereview.chromium.org/14617017
2013-05-13Start to disallow llvm.frameaddress and llvm.returnaddress in ABI checker.Jan Voung
They do not seem to be widely used by user code. * The boehm garbage collector library does reference __builtin_return_address under an ifdef, but it does not appear to be compiled in. * Mesa-7.6 uses __builtin_frame_address for u_debug_stack.c, but that also does not appear to be part of the built libraries. They expose stack/code addresses (at least the lower 32-bits of the address). As part of https://codereview.chromium.org/14619022/, we stopped considering the scons and gcc torture tests that use these intrinsics as meeting the stable ABI. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378 R=dschuff@chromium.org Review URL: https://codereview.chromium.org/14657017
2013-05-09Move llvm.eh.frame.cfa to the blacklist of intrinsics.Jan Voung
Tests that use them now skip ABI verification. Known tests that use this are the scons tests: - the barebones_stack_alignment16 test and - the EH ones under tests/toolchain/ Also list other eh_* in the blacklist more explicitly (they were already caught by the default case). BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378 TEST= scons, gcc torture, llvm R=dschuff@chromium.org Review URL: https://codereview.chromium.org/14998008
2013-05-08Put llvm.powi in the dev list of intrinsics.Jan Voung
This is used by the LLVM translator as part of: lib/Analysis/ConstantFolding.cpp (it tries to do constant folding for pow calls...) Also, tweak comment about llvm.pow vs llvm.powi. It looks like powi is the imprecise one, not pow. BUG=unblock DEPs roll, broken self-build. BUG=http://code.google.com/p/nativeclient/issues/detail?id=3378 R=eliben@chromium.org Review URL: https://codereview.chromium.org/14631013
2013-05-07Start a whitelist of intrinsics for the PNaCl ABI checker.Jan Voung
This list is currently too small to support our tests (scons, gcc, llvm). To prevent the tests from breaking, there is a -pnaclabi-allow-intrinsics flag which defaults to true. To turn on the checking for real, set -pnaclabi-allow-intrinsics=0. We will avoid actually using the -pnaclabi-allow-intrinsics flags in tests, and try to just stick with the -pnacl-disable-abi-check flag. Remove this flag soon. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378 R=eliben@chromium.org Review URL: https://codereview.chromium.org/14670017
2013-05-06Fix unchecked uses of DominatorTree in MemoryDependenceAnalysis.Matt Arsenault
Use unknown results for places where it would be needed git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181176 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03RegionInfo: Do not crash if unreachable block is foundTobias Grosser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181025 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01This patch breaks up Wrap.h so that it does not have to include all of Filip Pizlo
the things, and renames it to CBindingWrapping.h. I also moved CBindingWrapping.h into Support/. This new file just contains the macros for defining different wrap/unwrap methods. The calls to those macros, as well as any custom wrap/unwrap definitions (like for array of Values for example), are put into corresponding C++ headers. Doing this required some #include surgery, since some .cpp files relied on the fact that including Wrap.h implicitly caused the inclusion of a bunch of other things. This also now means that the C++ headers will include their corresponding C API headers; for example Value.h must include llvm-c/Core.h. I think this is harmless, since the C API headers contain just external function declarations and some C types, so I don't believe there should be any nasty dependency issues here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180881 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Struct-path aware TBAA: change the format of TBAAStructType node.Manman Ren
We switch the order of offset and field type to make TBAAStructType node (name, parent node, offset) similar to scalar TBAA node (name, parent node). TypeIsImmutable is added to TBAAStructTag node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180654 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Check for metadata in PNaCl ABI checker.Jan Voung
Disallow all metadata by default. There is a flag "-allow-debug-metadata", which will be used in pnacl-ld driver, to not change the debugging workflow. That flag will not be present in the pnacl-abicheck driver though. We'll also run -strip-metadata within pnacl-ld, after optimizations are run, so that at least that part is checked inside pnacl-ld. CL for driver changes: https://codereview.chromium.org/14358048/ BUG= http://code.google.com/p/nativeclient/issues/detail?id=3348 R=dschuff@chromium.org Review URL: https://codereview.chromium.org/14329025
2013-04-22Struct-path aware TBAA: update getMostGenericTBAA Manman Ren
The tag is of type TBAANode when flag EnableStructPathTBAA is off. Move implementation of MDNode::getMostGenericTBAA to TypeBasedAliasAnalysis.cpp since it depends on how to interprete the MDNodes for scalar TBAA and struct-path aware TBAA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22Move C++ code out of the C headers and into either C++ headersEric Christopher
or the C++ files themselves. This enables people to use just a C compiler to interoperate with LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180063 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22Fix bot build of translator, renormalize CMakeLists/LLVMBuild.txt/MakefileDerek Schuff
naming to better match upstream R=jvoung@chromium.org BUG=bot LLVM roll Review URL: https://codereview.chromium.org/14315012
2013-04-19ConstantFolding: ComputeMaskedBits wants the scalar size for vectors.Benjamin Kramer
Fixes PR15791. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Fix CMake buildDerek Schuff
Clean up the LLVMBuild and CMakeLists.txt files BUG=none TEST=none Review URL: https://codereview.chromium.org/14328017
2013-04-17A limit of 500 was still a bit too high for some tests.Bill Wendling
PR15000 has a testcase where the time to compile was bordering on 30s. When I dropped the limit value to 100, it became a much more managable 6s. The compile time seems to increase in a roughly linear fashion based on increasing the limit value. (See the runtimes below.) So, let's lower the limit to 100 so that they can get a more reasonable compile time. Limit Value Time ----------- ---- 10 0.9744s 20 1.8035s 30 2.3618s 40 2.9814s 50 3.6988s 60 4.5486s 70 4.9314s 80 5.8012s 90 6.4246s 100 7.0852s 110 7.6634s 120 8.3553s 130 9.0552s 140 9.6820s 150 9.8804s 160 10.8901s 170 10.9855s 180 12.0114s 190 12.6816s 200 13.2754s 210 13.9942s 220 13.8097s 230 14.3272s 240 15.7753s 250 15.6673s 260 16.0541s 270 16.7625s 280 17.3823s 290 18.8213s 300 18.6120s 310 20.0333s 320 19.5165s 330 20.2505s 340 20.7068s 350 21.1833s 360 22.9216s 370 22.2152s 380 23.9390s 390 23.4609s 400 24.0426s 410 24.6410s 420 26.5208s 430 27.7155s 440 26.4142s 450 28.5646s 460 27.3494s 470 29.7255s 480 29.4646s 490 30.5001s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15PNaCl ABI checker: Disallow the "resume" instructionMark Seaborn
This instruction is used for C++ exception handling. It is only used inside basic blocks reached from landingpads, so it is stripped out by the "-lowerinvoke" pass. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3377 TEST=NaCl small_tests Review URL: https://codereview.chromium.org/13832006
2013-04-13Fix a scalability issue with complex ConstantExprs.Benjamin Kramer
This is basically the same fix in three different places. We use a set to avoid walking the whole tree of a big ConstantExprs multiple times. For example: (select cmp, (add big_expr 1), (add big_expr 2)) We don't want to visit big_expr twice here, it may consist of thousands of nodes. The testcase exercises this by creating an insanely large ConstantExprs out of a loop. It's questionable if the optimizer should ever create those, but this can be triggered with real C code. Fixes PR15714. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12PNaCl: extend GlobalCleanup to null-out extern_weak function references, and ↵Derek Schuff
extend the ABI checker to verify. Also promote weak symbols to internal ones, which was required because the scons barebones tests define weak versions of memcpy/memset BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339 TEST= llvm-regression (globalcleanup.ll), scons barebones tests Review URL: https://codereview.chromium.org/13989005
2013-04-12PNaCl ABI checker: Disallow ConstantExprs inside functionsMark Seaborn
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3337 TEST=test/NaCl/PNaClABI/*.ll Review URL: https://codereview.chromium.org/13932023
2013-04-12PNaCl ABI checker: Disallow va_arg, varargs functions and varargs callsMark Seaborn
This doesn't disallow the va_start/va_end/va_copy intrinsics yet; these will get disallowed later when we add whitelisting of intrinsics to the PNaCl ABI checker. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338 TEST=test/NaCl/PNaClABI/*.ll Review URL: https://codereview.chromium.org/13884013
2013-04-12PNaCl ABI checker: Disallow invoke+landingpad instructionsMark Seaborn
The first release of the stable PNaCl ABI won't support zero-cost C++ exception handling. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3377 TEST=toolchain trybots + gcc torture tests + Spec2k + LLVM regression tests Review URL: https://codereview.chromium.org/14044006
2013-04-11Aliasing rules for struct-path aware TBAA.Manman Ren
Added PathAliases to check if two struct-path tags can alias. Added command line option -struct-path-tbaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179337 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10PNaCl ABI checker: Disallow the GetElementPtr instructionMark Seaborn
This instruction is removed by ExpandGetElementPtr. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343 TEST=test/NaCl/PNaClABI/instructions.ll + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/14071005
2013-04-10PNaCl ABI checker: Disallow "section", "thread_local" and "gc" attributesMark Seaborn
* Disallow "section" on functions and global variables. * Disallow "thread_local" on global variables. * Disallow "gc" on functions. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2837 BUG= https://code.google.com/p/nativeclient/issues/detail?id=3126 TEST=test/NaCl/PNaClABI/global-attributes.ll + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/14063007
2013-04-10RegionInfo: Add helpers to replace entry/exit recursivelyTobias Grosser
Contributed by: Star Tan <tanmx_star@yeah.net> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09Revert r176408 and r176407 to address PR15540.Nadav Rotem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09Revert 179071 because it is not the right way to support non standard ↵Nadav Rotem
new/new[] operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08c++ new operators are not malloc-like functions because they do not return ↵Nadav Rotem
uninitialized memory. Users may overide new-operators and implement any function that they like. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179071 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08InstructionSimplify.cpp: Fix a ligature, "fi", to get rid of utf8 in comment.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04CostModel: Add parameter to instruction cost to further classify operand valuesArnold Schwaighofer
On certain architectures we can support efficient vectorized version of instructions if the operand value is uniform (splat) or a constant scalar. An example of this is a vector shift on x86. We can efficiently support for (i = 0 ; i < ; i += 4) w[0:3] = v[0:3] << <2, 2, 2, 2> but not for (i = 0; i < ; i += 4) w[0:3] = v[0:3] << x[0:3] This patch adds a parameter to getArithmeticInstrCost to further qualify operand values as uniform or uniform constant. Targets can then choose to return a different cost for instructions with such operand values. A follow-up commit will test this feature on x86. radar://13576547 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01PNaCl: Tidy: Remove an unnecessary cast in the ABI checkerMark Seaborn
I noticed this while debugging a runtime cast assertion error. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=test/NaCl/PNaClABI/*.ll Review URL: https://codereview.chromium.org/13261012
2013-04-01PNaCl ABI checker: Disable integer size check since it doesn't pass yetMark Seaborn
We would like to enable the ABI checker as soon as possible so that we can iterate. The check can be re-enabled when it passes. FileCheck doesn't allow CHECKs to be commented out so we have to disrupt them instead. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 BUG=https://code.google.com/p/nativeclient/issues/detail?id=3360 TEST=run ABI checker on NaCl Scons-based tests Review URL: https://codereview.chromium.org/13375008
2013-04-01PNaCl: Fix ABI checker to give a better error message on BlockAddressesMark Seaborn
Before, the checker failed with a cast error, when trying to cast the BasicBlock in a BlockAddress to a Constant. Fix it so that we at least know which global initializer is being rejected. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=test/NaCl/PNaClABI/types.ll Review URL: https://codereview.chromium.org/13392004
2013-04-01PNaCl: Allow the ABI checker to be used from "opt"Mark Seaborn
This allows the ABI checker passes to be used in the same way as LLVM's "-verify" pass. It allows the checker to be run between other passes, and without launching pnacl-abicheck as a separate process (so without the overhead of reading bitcode into memory again). Make the ABI checker passes produce fatal errors by default, to match "-verify". This is overridden for pnacl-abicheck's use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=tested with pnacl-ld.py changes to use the ABI checker passes Review URL: https://codereview.chromium.org/13323006
2013-03-29Build fixes for STLPort + GCCMatt Arsenault
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29Fix loop styleMatt Arsenault
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178355 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26BasicAA: Only query twice if the result of the more general query was MayAliasArnold Schwaighofer
This is a compile time optimization. Before the patch we would do two traversals on each call to aliasGEP - one with a set size parameter one with UnknownSize. We can do better by first checking the result of the alias query with UnknownSize. Only if this one returns MayAlias do we query a second time using size and type. This recovers an about 7% compile time regression on spec/ammp. radar://12349960 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Fix SCEV forgetMemoizedResults should search and destroy backedge exprs.Andrew Trick
Fixes PR15570: SEGV: SCEV back-edge info invalid after dead code removal. Indvars creates a SCEV expression for the loop's back edge taken count, then determines that the comparison is always true and removes it. When loop-unroll asks for the expression, it contains a NULL SCEVUnknkown (as a CallbackVH). forgetMemoizedResults should invalidate the loop back edges expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177986 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22Support in AAEvaluator to print alias queries of loads/stores with TBAA tags.Manman Ren
Add "evaluate-tbaa" to print alias queries of loads/stores. Alias queries between pointers do not include TBAA tags. Add testing case for "placement new". TBAA currently says NoAlias. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Remove 'else' after 'return'.Jakub Staszak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Merge remote-tracking branch 'origin/master'Eli Bendersky
Merge Nacl-LLVM work since the upstream merge branched
2013-03-20Remove trailing spaces.Jakub Staszak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.Manman Ren
This handles the case where we have an inbounds GEP with alloca as the pointer. This fixes the regression in PR12750 and rdar://13286434. Note that we can also fix this by handling some GEP cases in isKnownNonNull. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177321 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Switch ABI verifier passes to manual initialization.Derek Schuff
This lines them up with the rest of the codebase and will make them work with statically-linked opt. R=mseaborn@chromium.org BUG=none TEST=existing tests keep working (we don't actually use static opt) Review URL: https://codereview.chromium.org/12902015
2013-03-14Fix LLVMBuild.txt for NaCl analysis passesDerek Schuff
R=jvoung@chromium.org BUG= Sandboxed LLC doesn't build correctly anymore without it Review URL: https://codereview.chromium.org/12432018
2013-03-13ABI verifier: Add standalone tool pnacl-abicheckDerek Schuff
This CL adds a standalone tool pnacl-abicheck for checking the ABI validity of a bitcode file. It also adds a flag pnaclabi-verify to llc to enable the same checking in llc. It also improves the mechanism for handling and reporting validation errors and uses it in both tools. R=jvoung@chromium.org,mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309 Review URL: https://codereview.chromium.org/12449014
2013-03-12Small fix for cost analysis of ptrtoint.Patrik Hagglund
This seems to be a "copy-paste error" introducecd in r156140. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11Merge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'Eli Bendersky
Conflicts: include/llvm/CodeGen/LexicalScopes.h include/llvm/MC/MCAsmInfo.h lib/Linker/LinkArchives.cpp lib/Linker/LinkItems.cpp lib/MC/MCAsmInfo.cpp lib/MC/MCDwarf.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMSubtarget.cpp lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp lib/Target/Mips/MipsAsmPrinter.cpp lib/Target/Mips/MipsDelaySlotFiller.cpp lib/Target/Mips/MipsISelDAGToDAG.cpp lib/Target/Mips/MipsSubtarget.cpp lib/Target/Mips/MipsSubtarget.h lib/Target/Mips/MipsTargetObjectFile.cpp lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86TargetMachine.cpp lib/Transforms/CMakeLists.txt lib/Transforms/LLVMBuild.txt lib/Transforms/Makefile test/MC/ARM/arm_instructions.s test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
2013-03-10Remove unneeded #includes. Use forward declarations instead.Jakub Staszak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176783 91177308-0d34-0410-b5e6-96231b3b80d8