llvm-project/llvm/lib
Roman Lebedev 25aebe2ccf
[LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case miscompilation for %x.next
While `%x.curr` is always safe to compute, because `LoopBackedgeTakenCount`
will always be smaller than `bitwidth(X)`, i.e. we never get poison,
rewriting `%x.next` is more complicated, however, because `X << LoopTripCount`
will be poison iff `LoopTripCount == bitwidth(X)` (which will happen
iff `BitPos` is `bitwidth(x) - 1` and `X` is `1`).

So unless we know that isn't the case (as alive2 notes, we know it's safe
to do iff shift had no-wrap flags, or bitpos does not indicate signbit,
or we know that %x is never `1`), we'll need to emit an alternative,
safe IR, by either just shifting the `%x.curr`, or conditionally selecting
between the computed `%x.next` and `0`..
Former IR looks better so let's do that.

While there, ensure that we don't drop no-wrap flags from said shift.
2020-12-24 21:20:52 +03:00
..
Analysis [Analysis] Remove spliceFunction (NFC) 2020-12-23 21:57:25 -08:00
AsmParser [DebugInfo] Support Fortran 'use <external module>' statement. 2020-12-18 13:10:57 -05:00
BinaryFormat [XCOFF][AIX] Emit EH information in traceback table 2020-12-16 09:34:59 -05:00
Bitcode [DebugInfo] Support Fortran 'use <external module>' statement. 2020-12-18 13:10:57 -05:00
Bitstream llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CodeGen [CodeGen] Remove unused function hasInlineAsmMemConstraint (NFC) 2020-12-24 09:17:58 -08:00
DWARFLinker [dsymutil][DWARFLinker][NFC] Make interface of AddressMap more general. 2020-12-10 14:57:08 +03:00
DebugInfo [llvm-symbolizer][Windows] Add start line when searching in line table sections. 2020-12-17 07:57:36 -08:00
Demangle llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
ExecutionEngine [ExecutionEngine, Linker] Use erase_if (NFC) 2020-12-23 21:44:39 -08:00
Extensions llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
FileCheck [FileCheck] Add a literal check directive modifier 2020-12-18 17:26:15 -08:00
Frontend [OpenMPIRBuilder] Various changes required for tileLoops. 2020-12-11 11:37:45 -06:00
FuzzMutate llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Fuzzer
IR Make NPM OptBisectInstrumentation use global singleton OptBisect 2020-12-20 13:47:56 -08:00
IRReader static const char *const foo => const char foo[] 2020-12-01 10:33:18 -08:00
InterfaceStub [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference. 2020-12-04 16:02:29 +03:00
LTO [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
LineEditor llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Linker [ExecutionEngine, Linker] Use erase_if (NFC) 2020-12-23 21:44:39 -08:00
MC [MC] Split MCContext::createTempSymbol, default AlwaysAddSuffix to true, and add comments 2020-12-21 14:04:13 -08:00
MCA [llvm-mca] Fix processing thumb instruction set 2020-11-24 18:27:59 +03:00
Object Replace `T(x)` with `reinterpret_cast<T>(x)` everywhere it means reinterpret_cast. NFC. 2020-12-22 19:54:29 -05:00
ObjectYAML [obj2yaml][yaml2obj] - Add AArch64 STO_AARCH64_VARIANT_PCS support 2020-12-17 11:09:53 -03:00
Option Remove memory allocation with string 2020-12-05 15:14:44 -08:00
Passes [NewPM] Fix objc-arc-apelim pass typo 2020-12-22 21:40:43 -08:00
ProfileData [NFC][SampleFDO] Preparation to support multiple sections with the same type 2020-12-16 22:28:45 -08:00
Remarks llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Support [AArch64] Add support for the Branch Record Buffer extension 2020-12-18 11:11:06 +00:00
TableGen [TableGen] Add the !substr() bang operator 2020-12-23 10:59:33 -05:00
Target [AMDGPU] Use MUBUF instructions for global address space access 2020-12-24 10:13:04 +00:00
Testing [llvm][NFC] Remove unnecessary vector creation in Annotations 2020-11-14 15:55:09 +00:00
TextAPI llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
ToolDrivers llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Transforms [LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case miscompilation for %x.next 2020-12-24 21:20:52 +03:00
WindowsManifest llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
XRay [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference. 2020-12-04 16:02:29 +03:00
CMakeLists.txt llvmbuildectomy - support disabled native target 2020-11-13 15:50:13 +01:00