File: extract_constant_factor_introduces_new_parameter.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (41 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
; RUN: opt %loadPolly -polly-scops -analyze < %s

; CHECK: Valid Region for Scop: bb10 => bb16

; Verify that -polly-scops does not crash. At some point this piece of
; code crashed as we extracted from the SCEV expression:
;
;    ((8 * ((%a * %b) + %c)) + (-8 * %a))'
;
; the constant 8, which resulted in the new expression:
;
;    (((-1 + %b) * %a) + %c)
;
; which introduced a new parameter (-1 + %b) * %a which was not registered
; correctly and consequently caused a crash due to an expression not being
; regiustered as a parameter.

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"

define void @barney(i32* %arg, i32* %arg1, double* %arg2, i32* %arg3, i32 %a, i32 %b, i32 %c) {
bb:
  br label %bb10

bb10:                                             ; preds = %bb
  br i1 true, label %bb11, label %bb16

bb11:                                             ; preds = %bb10
  %tmp4 = add nsw i32 1, %a
  %tmp5 = sub i32 0, %tmp4
  %tmp8 = add nsw i32 %c, 1
  %tmp12 = mul nsw i32 %b, %a
  %tmp13 = add nsw i32 %tmp8, %tmp12
  %tmp6 = getelementptr inbounds double, double* %arg2, i32 %tmp5
  %tmp14 = getelementptr inbounds double, double* %tmp6, i32 %tmp13
  %tmp15 = load double, double* %tmp14
  br label %bb16

bb16:                                             ; preds = %bb11, %bb10
  ret void
}