1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test
Sanjoy Das 9baaae9344 [SCEV] Don't always add no-wrap flags to post-inc add recs
Fixes PR27315.

The post-inc version of an add recurrence needs to "follow the same
rules" as a normal add or subtract expression.  Otherwise we miscompile
programs like

```
int main() {
  int a = 0;
  unsigned a_u = 0;
  volatile long last_value;
  do {
    a_u += 3;
    last_value = (long) ((int) a_u);
    if (will_add_overflow(a, 3)) {
      // Leave, and don't actually do the increment, so no UB.
      printf("last_value = %ld\n", last_value);
      exit(0);
    }
    a += 3;
  } while (a != 46);
  return 0;
}
```

This patch changes SCEV to put no-wrap flags on post-inc add recurrences
only when the poison from a potential overflow will go ahead to cause
undefined behavior.

To avoid regressing performance too much, I've assumed infinite loops
without side effects is undefined behavior to prove poison<->UB
equivalence in more cases.  This isn't ideal, but is not new to LLVM as
a whole, and far better than the situation I'm trying to fix.

llvm-svn: 271151
2016-05-29 00:32:17 +00:00
..
Analysis [SCEV] Don't always add no-wrap flags to post-inc add recs 2016-05-29 00:32:17 +00:00
Assembler Fix constant folding of addrspacecast of null 2016-05-21 00:14:04 +00:00
Bindings
Bitcode Objective-C Class Properties: Autoupgrade "Class Properties" module flag. 2016-05-25 23:14:48 +00:00
BugPoint
CodeGen [X86][SSE] (Reapplied) Replace (V)PMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (llvm) 2016-05-28 18:03:41 +00:00
DebugInfo Update test to deal with non-zero exit codes 2016-05-28 19:02:12 +00:00
Examples
ExecutionEngine [MIPS][LLVM-MC] Fix Disassemble of Negative Offset 2016-05-24 09:57:10 +00:00
Feature Update the stack coloring pass to remove lifetime intrinsics in the optnone/opt-bisect skip case. 2016-05-27 22:56:49 +00:00
FileCheck Fix windows build bot failure 2016-05-28 00:03:35 +00:00
Instrumentation [esan|wset] EfficiencySanitizer working set tool fastpath 2016-05-25 00:17:24 +00:00
Integer
JitListener
LibDriver
Linker ValueMapper: fix assertion when null-mapping a constant for linking metadata 2016-05-28 17:26:03 +00:00
LTO
MC Fix production of R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX. 2016-05-28 15:51:38 +00:00
Object llvm-objdump: support dumping AUX records for weak externals 2016-05-26 01:45:12 +00:00
ObjectYAML [obj2yaml][yaml2obj] Support for MachO lazy bindings 2016-05-26 21:29:39 +00:00
Other Update the stack coloring pass to remove lifetime intrinsics in the optnone/opt-bisect skip case. 2016-05-27 22:56:49 +00:00
SymbolRewriter
TableGen
ThinLTO/X86 [ThinLTO] Resolve LinkOnceAny 2016-05-26 14:16:52 +00:00
tools Linker: teach the IR mover to return llvm::Error. 2016-05-27 05:21:35 +00:00
Transforms [SCEV] Don't always add no-wrap flags to post-inc add recs 2016-05-29 00:32:17 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg test: Be consistent with clang's sanitizer lit config 2016-05-23 23:02:11 +00:00
lit.site.cfg.in Add the printing the Mach-O (__LLVM,__bundle) xar archive file section "verbosely" 2016-05-23 21:34:12 +00:00
TestRunner.sh