summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* PR44890: Inherit explicitly-specified template arguments into base classRichard Smith2020-02-193-1/+25
| | | | | | deduction. (cherry picked from commit 34bd51f4b1d9f489e61becb662bdc72bb56dd277)
* [libcxx] Support Python 3.8 in the test suiteSergej Jaskiewicz2020-02-191-2/+12
| | | | | | | | | | | | | | | | Summary: `platform.linux_distribution()` has been deprecated in Python 3.5 and removed in Python 3.8. Reviewers: bcain, bcraig, jroelofs, EricWF, mclow.lists, ldionne Reviewed By: jroelofs Subscribers: dexonsmith, christof, ldionne, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D72501 (cherry picked from commit 7b8dc8c57697e95fd0b1248e4494ecc0f929aba1)
* [FPEnv][ARM] Don't call mutateStrictFPToFP when loweringJohn Brawn2020-02-182-2/+55
| | | | | | | | | | | | mutateStrictFPToFP can delete the node and replace it with another with the same value which can later cause problems, and returning the result of mutateStrictFPToFP doesn't work because SelectionDAGLegalize expects that the returned value has the same number of results as the original. Instead handle things by doing the mutation manually. Differential Revision: https://reviews.llvm.org/D74726 (cherry picked from commit 594a89f7270da74c89f2321432bc6a7135773fa5)
* [AArch64][FPenv] Update chain of int to fp conversionDiogo Sampaio2020-02-182-2/+75
| | | | | | | | | | | | | | | | | | | Summary: When using strict fp, it is required to update the chain when performing integer type promotion of a operand to a integer to floating point conversion. Reviewers: craig.topper, john.brawn Reviewed By: craig.topper Subscribers: kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74597 (cherry picked from commit 8bc790f9e6a6fc6d8fe8f41a7120269366fa0957)
* [ARM] Fix infinite loop when lowering STRICT_FP_EXTENDJohn Brawn2020-02-182-19/+48
| | | | | | | | | | | | | | | | If the target has FP64 but not FP16 then we have custom lowering for FP_EXTEND and STRICT_FP_EXTEND with type f64. However if the extend is from f32 to f64 the current implementation will cause in infinite loop for STRICT_FP_EXTEND due to emitting a merge_values of the original node which after replacement becomes a merge_values of itself. Fix this by not doing anything for f32 to f64 extend when we have FP64, though for STRICT_FP_EXTEND we have to do the strict-to-nonstrict mutation as that doesn't happen automatically for opcodes with custom lowering. Differential Revision: https://reviews.llvm.org/D74559 (cherry picked from commit 0ec57972967dfb43fc022c2e3788be041d1db730)
* [FPEnv][AArch64] Add lowering of f128 STRICT_FSETCCJohn Brawn2020-02-182-3/+195
| | | | | | | | These get lowered to function calls, like the non-strict versions. Differential Revision: https://reviews.llvm.org/D73784 (cherry picked from commit 68cf574857c81f711f498a479855a17e7bea40f7)
* [FPEnv][ARM] Add lowering of STRICT_FSETCC and STRICT_FSETCCSJohn Brawn2020-02-184-18/+526
| | | | | | | | | | | | | | | These can be lowered to code sequences using CMPFP and CMPFPE which then get selected to VCMP and VCMPE. The implementation isn't fully correct, as the chain operand isn't handled correctly, but resolving that looks like it would involve changes around FPSCR-handling instructions and how the FPSCR is modelled. The fp-intrinsics test was already testing some of this but as the entire test was being XFAILed it wasn't noticed. Un-XFAIL the test and instead leave the cases where we aren't generating the right instruction sequences as FIXME. Differential Revision: https://reviews.llvm.org/D73194 (cherry picked from commit b37d59353f699e99f139a9227a6a69964ef4b132)
* [FPEnv][AArch64] Add lowering and instruction selection for strict conversionsJohn Brawn2020-02-184-63/+464
| | | | | | | | | | Strict fp-to-int and int-to-fp conversions can be handled in the same way that the non-strict versions are (by using the appropriate instruction or converting to a function call when we have no instruction). Differential Revision: https://reviews.llvm.org/D73625 (cherry picked from commit 0bb9a27c9895c0fbc3f55f56ad7f1e1927398fce)
* [FPEnv][AArch64] Add lowering and instruction selection for STRICT_FP_ROUNDJohn Brawn2020-02-183-11/+34
| | | | | | | | | | This gets selected to the appropriate fcvt instruction. Handling from there on isn't fully correct yet, as we need to model fcvt reading and writing to fpsr and fpcr. Differential Revision: https://reviews.llvm.org/D73201 (cherry picked from commit 258d8dd76afd88a12539b182a53ff21dcba16a2d)
* Add lowering of STRICT_FSETCC and STRICT_FSETCCSJohn Brawn2020-02-184-11/+1031
| | | | | | | | | | These become STRICT_FCMP and STRICT_FCMPE, which then get selected to the corresponding FCMP and FCMPE instructions, though the handling from there on isn't fully correct as we don't model reads and writes to FPCR and FPSR. Differential Revision: https://reviews.llvm.org/D73368 (cherry picked from commit 2224407ef5baf6100fa22420feb4d25af1a9493f)
* Drop git version suffixAaron Puchert2020-02-174-4/+4
| | | | | | | | | | | | | | Summary: Also fix the version for libcxxabi, which was stuck in the past. Reviewers: hans, mclow.lists Reviewed By: hans Subscribers: mgorny, christof, libcxx-commits, llvm-commits, ldionne Tags: #libc, #llvm Differential Revision: https://reviews.llvm.org/D74586
* Fix crash in InfinteLoopCheckNathan James2020-02-171-0/+2
| | | | (cherry picked from commit 8c4cf23dee1ac3f259c4795b275cc9bb1234aa29)
* [clangd] Expose Code Completion score to the clientKirill Bobyrev2020-02-138-0/+21
| | | | | | | | | | | | | | | | Summary: Make it possible for the client to adjust the ranking by using the score Clangd calculates for the completion items. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74547 (cherry picked from commit ff7b5bac04fa4946935ea45214e29f267d6c1d7b)
* Linker/module-max-warn.ll: Fix test to be compatible with Windows file ↵David Blaikie2020-02-131-2/+2
| | | | | | separators (cherry picked from commit 84eeee65804ba070c50978be1c741a1756779079)
* [Clang] Limit -fintegrated-cc1 to only one TUAlexandre Ganea2020-02-135-18/+55
| | | | | | | | | | As discussed in https://reviews.llvm.org/D74447, this patch disables integrated-cc1 behavior if there's more than one job to be executed. This is meant to limit memory bloating, given that currently jobs don't clean up after execution (-disable-free is always active in cc1 mode). I see this behavior as temporary until release 10.0 ships (to ease merging of this patch), then we'll reevaluate the situation, see if D74447 makes more sense on the long term. Differential Revision: https://reviews.llvm.org/D74490 (cherry picked from commit 20f1abe306d030e99f56185a3aa077ffadf59b8a)
* Fix a reentrance bug with deserializing ObjC type parameters.John McCall2020-02-134-1/+26
| | | | | | | | | | | | | This is a longstanding bug that seems to have been hidden by a combination of (1) the normal flow being to deserialize the interface before deserializing its parameter and (2) a precise ordering of work that was apparently recently disturbed, perhaps by my abstract-serialization work or Bruno's ObjC module merging work. Fixes rdar://59153545. (cherry picked from commit 77b2ffc498e92cce7546d191f6712a3046300501)
* Fix type-dependency of bitfields in templatesElizabeth Andrews2020-02-133-1/+20
| | | | | | | | | | | | | This patch is a follow up to 878a24ee244a24. Name of bitfields with value-dependent width should be set as type-dependent. This patch adds the required value-dependency check and sets the type-dependency accordingly. Patch fixes PR44886 Differential revision: https://reviews.llvm.org/D72242 (cherry picked from commit a58017e5cae5be948fd1913b68d46553e87aa622)
* [CodeGen] Fix the computation of the alignment of split stores.Hans Wennborg2020-02-123-2/+195
| | | | | | By Clement Courbet! Backported from rG15488ff24b4a
* [Concepts] Add missing TPA commit to requires expression parsingSaar Raz2020-02-121-0/+1
| | | | | | | | | | If an error had occurred when annotating a scope spec during the tentative parse for a type-requirement, we would not revert nor commit the tentative parse, triggerring an assertion failure. Commit the TPA in this case and then do error recovery. (cherry picked from commit 271e495399170d69627c1acd591c9298cb0b5b4b)
* [Concepts] Do not check constraints if not all template arguments have been ↵Saar Raz2020-02-122-6/+15
| | | | | | | | | | | | | deduced We previously checked the constraints of instantiated function templates even in cases where PartialOverloading was true and not all template arguments have been deduced, which caused crashes in clangd (bug 44714). We now check if all arguments have been deduced before checking constraints in partial overloading scenarios. (cherry picked from commit 5fef14d932fe602bf998b8fb8a809ff85ca1e245)
* Fix an unused variable warningHans Wennborg2020-02-121-1/+1
| | | | (cherry picked from commit ea9850b6c71d975935de15bd4128508b260165c5)
* [X86] Cast to __v4hi instead of __m64 in the implementation of ↵Craig Topper2020-02-121-2/+2
| | | | | | | | | | | _mm_extract_pi16 and _mm_insert_pi16. __m64 is a vector of 1 long long. But the builtins these intrinsics are calling expect a vector of 4 shorts. Fixes PR44589 (cherry picked from commit 16b9410caa35da976fa5f3cf6dd3d6f3776d51ca)
* Revert "[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field"Jeremy Morse2020-02-1223-120/+97
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit ed29dbaafa49bb8c9039a35f768244c394411fea. I'm backing out D68945, which as the discussion for D73526 shows, doesn't seem to handle the -O0 path through the codegen backend correctly. I'll reland the patch when a fix is worked out, apologies for all the churn. The two parent commits are part of this revert too. Conflicts: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/test/DebugInfo/X86/dbg-addr-dse.ll SelectionDAGBuilder conflict is due to a nearby change in e39e2b4a79c6 that's technically unrelated. dbg-addr-dse.ll conflicted because 41206b61e30c (legitimately) changes the order of two lines. There are further modifications to dbg-value-func-arg.ll: it landed after the patch being reverted, and I've converted indirection to be represented by the isIndirect field rather than DW_OP_deref. (cherry picked from commit 6531a78ac4b5b229bce272706593a0bc873877d7)
* Revert "[DebugInfo][DAG] Distinguish different kinds of location indirection"Jeremy Morse2020-02-123-106/+7
| | | | | | | | | | | | | | This reverts commit 3137fe4d23eeb8df08c03e9111465325eeafe08e. I'm backing out D68945, which this patch is a follow up for. It'll be re-landed when D68945 is fixed. The changes to dbg-value-func-arg.ll occur because our handling of certain kinds of location now mixes up indirection that happens at different points in a DIExpression. While this is a regression, it's a return to the prior behaviour while a better patch is sought. (cherry picked from commit ece761427f63de96ee52bbd6be1c61b07967a917)
* [DebugInfo] Re-instate LiveDebugVariables scope trimmingJeremy Morse2020-02-123-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch reverts part of r362750 / D62650, which stopped LiveDebugVariables from trimming leading variable location ranges down to only covering those instructions that are in scope. I've observed some circumstances where the number of DBG_VALUEs in a function can be amplified in an un-necessary way, to cover more instructions that are out of scope, leading to very slow compile times. Trimming the range of instructions that the variables cover solves the slow compile times. The specific problem that r362750 tries to fix is addressed by the assignment to RStart that I've added. Any variable location that begins at the first instruction of a block will now be considered to begin at the start of the block. While these sound the same, the have different SlotIndexes, and the register allocator may shoehorn additional instructions in between the two. The test added in the past (wrong_debug_loc_after_regalloc.ll) still works with this modification. live-debug-variables.ll has a range trimmed to not cover the prologue of the function, while dbg-addr-dse.ll has a DBG_VALUE sink past one instruction with no DebugLoc, which is expected behaviour. Differential Revision: https://reviews.llvm.org/D73691 (cherry picked from commit 41206b61e30c3d84188cb17b91c2c0c800982dd1)
* [clang-tidy] Added check to disable bugprone-infinite-loop on known false ↵Nathan James2020-02-122-0/+19
| | | | | | | | | | | | | | | | | | condition Summary: Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=44816 | bugprone-infinite-loop false positive with CATCH2 ]] by disabling the check on loops where the condition is known to always eval as false, in other words not a loop. Reviewers: aaron.ballman, alexfh, hokein, gribozavr2, JonasToth Reviewed By: gribozavr2 Subscribers: xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D74374 (cherry picked from commit c69ec6476806147e46bf09b693acb24177982dc2)
* [OpenCL] Restrict addr space conversions in nested pointersAnastasia Stulova2020-02-128-17/+86
| | | | | | | | | | | | | | | | | | | | | | Address space conversion changes pointer representation. This commit disallows such conversions when they are not legal i.e. for the nested pointers even with compatible address spaces. Because the address space conversion in the nested levels can't be generated to modify the pointers correctly. The behavior implemented is as follows: - Any implicit conversions of nested pointers with different address spaces is rejected. - Any conversion of address spaces in nested pointers in safe casts (e.g. const_cast or static_cast) is rejected. - Conversion in low level C-style or reinterpret_cast is accepted but with a warning (this aligns with OpenCL C behavior). Fixes PR39674 Differential Revision: https://reviews.llvm.org/D73360 (cherry picked from commit 6064f426a18304e16b51cc79e74c9c2d55ef5a9c)
* Fix MSVC build with C++ EH enabledReid Kleckner2020-02-121-1/+1
| | | | | | | | | | | | | | | | | Mark the CrashRecoveryContextImpl constructor noexcept, so that MSVC won't emit an unwind helper to clean up the allocation from `new` if the constructor throws an exception. Otherwise, MSVC complains: llvm\lib\Support\CrashRecoveryContext.cpp(220): error C2712: \ Cannot use __try in functions that require object unwinding The other simple fix would be to wrap `new` in a static helper or lambda. Users have reported that Tensorflow builds LLVM with /EHsc. (cherry picked from commit a349c09162a8260bdf691c4f7ab72a16c33975f6)
* [SystemZ] Bugfix in emitSelect()Jonas Paulsson2020-02-122-2/+46
| | | | | | | | | | | | | | When more than one SelectPseudo instruction is handled a new MBB is returned. This must not be done if that would result in leaving an undhandled isel pseudo behind in the original MBB. Fixes https://bugs.llvm.org/show_bug.cgi?id=44849. Review: Ulrich Weigand Differential Revision: https://reviews.llvm.org/D74352 (cherry picked from commit 0311e28e9cc01a244faa774b8cab337b45404fa9)
* [Clang][Driver] After default -fintegrated-cc1, make ↵Alexandre Ganea2020-02-128-9/+59
| | | | | | | | | | | | | llvm::report_fatal_error() generate preprocessed source + reproducer.sh again. Added a test for #pragma clang __debug llvm_fatal_error to test for the original issue. Added llvm::sys::Process::Exit() and replaced ::exit() in places where it was appropriate. This new function would call the current CrashRecoveryContext if one is running on the same thread; or call ::exit() otherwise. Fixes PR44705. Differential Revision: https://reviews.llvm.org/D73742 (cherry picked from commit faace365088a2a3a4cb1050a9facfc34a7a56577)
* Add SystemZ release notesUlrich Weigand2020-02-111-0/+13
|
* [Support] Don't modify the current EH context during stack unwindingReid Kleckner2020-02-111-1/+7
| | | | | | | | | | | | | Copy it instead. Otherwise, key registers (such as RBP) may get zeroed out by the stack unwinder. Fixes CrashRecoveryTest.DumpStackCleanup with MSVC in release builds. Reviewed By: stella.stamenova Differential Revision: https://reviews.llvm.org/D73809 (cherry picked from commit b074acb82f7e75a189fa7933b09627241b166121)
* IR Linking: Support merging Warning+Max module metadata flagsDavid Blaikie2020-02-114-24/+65
| | | | | | | | | | | | | | | | | Summary: Debug Info Version was changed to use "Max" instead of "Warning" per the original design intent - but this maxes old/new IR unlinkable, since mismatched merge styles are a linking failure. It seems possible/maybe reasonable to actually support the combination of these two flags: Warn, but then use the maximum value rather than the first value/earlier module's value. Reviewers: tejohnson Differential Revision: https://reviews.llvm.org/D74257 (cherry picked from commit ba9cae58bbdd41451ee67773c9d0f90a01756f12)
* Prefer __vector over vector keyword for altivecserge-sans-paille2020-02-111-2/+2
| | | | | | | | | | | `vector' uses the keyword-and-predefine mode from gcc, while __vector is reliably supported. As a side effect, it also makes the code consistent in its usage of __vector. Differential Revision: https://reviews.llvm.org/D74129 (cherry picked from commit 3185c30c54d0af5bffbff3bcfd721668d086ff10)
* ReleaseNotes / external projects: ZigHans Wennborg2020-02-101-1/+11
|
* Re-land "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid ↵Alexandre Ganea2020-02-108-17/+118
| | | | | | | | | | | crashing when generating crash diagnostics when '#pragma clang __debug ..." This re-lands commits f41ec709d9d388dc43469e6ac7f51b6313f7e4af (https://reviews.llvm.org/D74076) and commit 5fedc2b410853a6aef05e8edf19ebfc4e071e28f (https://reviews.llvm.org/D74070) The previous build break was caused by '#pragma clang __debug llvm_unreachable' used in a non-assert build. Move it to a separate test in crash-report-with-asserts.c. (cherry picked from commit 75f09b54429bee17a96e2ba7a2ac0f0a8a7f7e74)
* [Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI.Alexandre Ganea2020-02-101-25/+35
| | | | | | | | | | Previously, the SEH codepath in CrashRecoveryContext didn't create a CrashRecoveryContextImpl. The other codepaths (VEH and Unix) were creating it. When running with -fintegrated-cc1, this is needed to handle exit() as a jump to CrashRecoveryContext's exception filter, through a call to RaiseException. In that situation, we need a user-defined exception code, which is later interpreted as an exit() by the exception filter. This in turn needs to set RetCode accordingly, *inside* the exception filter, and *before* calling HandleCrash(). Differential Revision: https://reviews.llvm.org/D74078 (cherry picked from commit 2a3fa0fc5cd7d3398c0293915b0e569eaa0be24b)
* [analyzer] Add 10.0.0 release notes.Hans Wennborg2020-02-101-4/+18
| | | | | | Differential revision: https://reviews.llvm.org/D73966 By Kristóf Umann!
* [Clang] Remove unused #pragma clang __debug handle_crashAlexandre Ganea2020-02-103-17/+0
| | | | | | | | | As discussed in D70568, remove this because it isn't used anywhere, and I think it's better to go through real crashes for testing (#pragma clang __debug crash). Also remove the support function llvm::CrashRecoveryContext::HandleCrash() which was added at the same time by @ddunbar. Differential Revision: https://reviews.llvm.org/D74063 (cherry picked from commit 8ecde3ac34bbb5a8d53d8ec5cd32867658646df1)
* [AArch64] Add option to enable/disable load-store renaming.Florian Hahn2020-02-109-15/+28
| | | | | | | | This patch adds a new option to enable/disable register renaming in the load-store optimizer. Defaults to disabled, as there is a potential mis-compile caused by this. (cherry picked from commit 8e3f59b45ae185cc9b4e3a817d7ac958f1d55976)
* AMDGPU/EG,CM: Implement fsqrt using recip(rsqrt(x)) instead of x * rsqrt(x)Jan Vesely2020-02-104-18/+34
| | | | | | | | | | | | The old version might be faster on EG (RECIP_IEEE is Trans only), but it'd need extra corner case checks. This gives correct corner case behaviour and saves a register. Fixes OCL CTS sqrt test (1-thread, scalar) on Turks. Reviewer: arsenm Differential Revision: https://reviews.llvm.org/D74017 (cherry picked from commit e6686adf8a743564f0c455c34f04752ab08cf642)
* [clang-tidy] Fix false positive for cppcoreguidelines-init-variablesNathan James2020-02-102-5/+15
| | | | | | | | | | | | | | | | Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44746 | False positive for cppcoreguidelines-init-variables in range based for loop in template function ]] Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2 Reviewed By: aaron.ballman Subscribers: merge_guards_bot, xazax.hun, wuzish, nemanjai, kbarton, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D73843 (cherry picked from commit efcd09cea9a51c522954aa24e4b5513266daf6c3)
* [X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2Craig Topper2020-02-102-1/+25
| | | | | | | | | | | | X86 uses i8 for shift amounts. This code can fail on a 32-bit target if it runs after type legalization. This code was copied from AArch64 and modified for X86, but the shift amount wasn't changed to the correct type for X86. Fixes PR44812 (cherry picked from commit ec9a94af4d5fb3270f2451fcbec5a3a99f4ac03a)
* [BPF] disable ReduceLoadWidth during SelectionDag phaseYonghong Song2020-02-102-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | The compiler may transform the following code ctx = ctx + reloc_offset ... (*(u32 *)ctx) & 0x8000 ... to ctx = ctx + reloc_offset ... (*(u8 *)(ctx + 1)) & 0x80 ... where reloc_offset will be replaced with a constant during AsmPrinter phase. The above transformed code will be rejected the kernel verifier as it does not allow *(type *)((ctx + non_zero_offset1) + non_zero_offset2) style access pattern. It is hard at SelectionDag phase to identify whether a load is related to context or not. Sometime, interprocedure analysis may be needed. So let us simply prevent such optimization from happening. Differential Revision: https://reviews.llvm.org/D73997 (cherry picked from commit d96c1bbaa03574daf759e5e9a6c75047c5e3af64)
* [analyzer] Fix a couple of bugs in HTML report generation.Artem Dergachev2020-02-105-1/+121
| | | | | | | | It should now produce valid HTML again. Differential Revision: https://reviews.llvm.org/D73993 (cherry picked from commit 482e236e569e8324f70778af1eb756923cd490dc)
* [cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ONTom Stellard2020-02-101-1/+16
| | | | | | | | | | | | | | | | | | | Summary: We were linking all the clang objects and shared libraries into libclang-cpp.so, which was causing the command line options to be registered twice. Reviewers: beanz, mgorny Reviewed By: beanz, mgorny Subscribers: merge_guards_bot, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68520 (cherry picked from commit ebcf25ea8100fc9987fd1edd1975194addc2fc05)
* [ARM] Fix non-determenistic behaviourDiogo Sampaio2020-02-101-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ARM Type Promotion pass does not clear the container that defines if one variable was visited or not, missing optimization opportunities by luck when two llvm:Values from different functions are allocated at the same memory address. Also fixes a comment and uses existing method to pop and obtain last element of the worklist. Reviewers: samparker Reviewed By: samparker Subscribers: kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73970 (cherry picked from commit 8ba2b6281075c65c1a47abed57810e1201942533)
* PowerPC release notesHans Wennborg2020-02-101-1/+23
| | | | By Anil Mahmud.
* [InstCombine] Fix infinite min/max canonicalization loop (PR44541)Nikita Popov2020-02-102-0/+31
| | | | | | | | | | | | While D72944 also fixes https://bugs.llvm.org/show_bug.cgi?id=44541, it does so in a more roundabout manner and there might be other loopholes to trigger the same issue. This is a more direct fix, that prevents the transform if the min/max is based on a non-canonical sub X, 0 instruction. Differential Revision: https://reviews.llvm.org/D73849 (cherry picked from commit a148b9e9909db6a592609eb35b4de38c9e67cb8b)
* [InstCombine] Support disabling expensive combines in optNikita Popov2020-02-102-2/+3
| | | | | | | | | | | | | | | Currently, there is no way to disable ExpensiveCombines when doing a standalone opt -instcombine run, as that's the default, and the opt option can currently only be used to force enable, not to force disable. The only way to disable expensive combines is via -O1 or -O2, but that of course also runs the rest of the kitchen sink... This patch allows using opt -instcombine -expensive-combines=0 to run InstCombine without ExpensiveCombines. Differential Revision: https://reviews.llvm.org/D72861 (cherry picked from commit 2ca092f3209579fde7a38ade511c1bbcef213c36)
OpenPOWER on IntegriCloud