Hello I have following c++ code
class classBase
{
public:
int get1(){return 1;}
int get2(){return 2;}
};
class classDer:public classBase
{
public:
int get1(){return 1;}
};
int f()
{
classDer x;
return x.get1();
}
I use following clangExample.cpp -S -emit-llvm -o - command and get
; ModuleID = 'C:\clangParam\clangExample.cpp'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i686-pc-win32"
%class.classDer = type { i8 }
define i32 #_Z1fv() {
entry:
%x = alloca %class.classDer, align 1
%call = call i32 #_ZN8classDer4get1Ev(%class.classDer* %x)
ret i32 %call
}
define linkonce_odr i32 #_ZN8classDer4get1Ev(%class.classDer* %this) nounwind align 2 {
entry:
%this.addr = alloca %class.classDer*, align 4
store %class.classDer* %this, %class.classDer** %this.addr, align 4
%this1 = load %class.classDer** %this.addr
ret i32 1
}
why there is no reference to the base class?(going over clang code for type generation I got the feeling that the base class type should be referenced.
Update
It makes sense
But if I use Template definition
template<class T>
class classTemplate
{
public:
T getMax(T in1,T in2){if(in2 > in1) return in2;return in1;}
};
int f()
{
classTemplate<int> x;
return x.getMax(3,4);
}
I get clang output
C:\Windows\system32>clang C:\clangParam\clangExample.cpp -S -emit-llvm -o -
; ModuleID = 'C:\clangParam\clangExample.cpp'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i686-pc-win32"
%class.classTemplate = type { i8 }
define i32 #_Z1fv() {
entry:
%x = alloca %class.classTemplate, align 1
%call = call i32 #_ZN13classTemplateIiE6getMaxEii(%class.classTemplate* %x, i32 3, i32 4)
ret i32 %call
}
define linkonce_odr i32 #_ZN13classTemplateIiE6getMaxEii(%class.classTemplate* %this, i32 %in1, i32 %in2) nounwind align 2 {
entry:
%retval = alloca i32, align 4
%this.addr = alloca %class.classTemplate*, align 4
%in1.addr = alloca i32, align 4
%in2.addr = alloca i32, align 4
store %class.classTemplate* %this, %class.classTemplate** %this.addr, align 4
store i32 %in1, i32* %in1.addr, align 4
store i32 %in2, i32* %in2.addr, align 4
%this1 = load %class.classTemplate** %this.addr
%tmp = load i32* %in2.addr, align 4
%tmp2 = load i32* %in1.addr, align 4
%cmp = icmp sgt i32 %tmp, %tmp2
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%tmp3 = load i32* %in2.addr, align 4
store i32 %tmp3, i32* %retval
br label %return
if.end: ; preds = %entry
%tmp4 = load i32* %in1.addr, align 4
store i32 %tmp4, i32* %retval
br label %return
return: ; preds = %if.end, %if.then
%0 = load i32* %retval
ret i32 %0
}
There is again no reference to template class though I initialize it.
The reason why it is not exported and not even compiled is because functions inside class-declarations are inlined. That means they are only known and compiled inside that particular codefile.
If you would put the class-declaration into a headerfile each .cpp-file would compile the code for the get1() and get2() functions seperately (so it would be present twice in the final executable).
ClassBase::get1() and ClassBase::get2() are never referenced, and so they are left out.
The same applies for the possibility of class-overloading: The compiler knows, that there is no derivative of any of the classes, because he sees all there could possibly be.
Why do you expect debug information without passing -g? This outputs a lot of metadata nodes:
// clang++ -g3 -S -emit-llvm main1.cpp
// ...
!0 = metadata !{i32 589841, i32 0, i32 4, metadata !"main1.cpp", metadata !"/home/js/cpp", metadata !"clang version 3.0 (trunk 134121)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
!1 = metadata !{i32 589870, i32 0, metadata !2, metadata !"f", metadata !"f", metadata !"_Z1fv", metadata !2, i32 16, metadata !3, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, i32 ()* #_Z1fv, null, null} ; [ DW_TAG_subprogram ]
!2 = metadata !{i32 589865, metadata !"main1.cpp", metadata !"/home/js/cpp", metadata !0} ; [ DW_TAG_file_type ]
!3 = metadata !{i32 589845, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !4, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!4 = metadata !{metadata !5}
!5 = metadata !{i32 589860, metadata !0, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
!6 = metadata !{i32 589870, i32 0, metadata !7, metadata !"get1", metadata !"get1", metadata !"_ZN9classBase4get1Ev", metadata !2, i32 5, metadata !10, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null} ; [ DW_TAG_subprogram ]
!7 = metadata !{i32 589826, metadata !0, metadata !"classBase", metadata !2, i32 2, i64 8, i64 8, i32 0, i32 0, null, metadata !8, i32 0, null, null} ; [ DW_TAG_class_type ]
!8 = metadata !{metadata !6, metadata !9, metadata !13}
!9 = metadata !{i32 589870, i32 0, metadata !7, metadata !"get2", metadata !"get2", metadata !"_ZN9classBase4get2Ev", metadata !2, i32 6, metadata !10, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null} ; [ DW_TAG_subprogram ]
!10 = metadata !{i32 589845, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !11, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!11 = metadata !{metadata !5, metadata !12}
!12 = metadata !{i32 589839, metadata !0, metadata !"", i32 0, i32 0, i64 32, i64 32, i64 0, i32 64, metadata !7} ; [ DW_TAG_pointer_type ]
!13 = metadata !{i32 589870, i32 0, metadata !7, metadata !"classBase", metadata !"classBase", metadata !"", metadata !2, i32 2, metadata !14, i1 false, i1 false, i32 0, i32 0, null, i32 320, i1 false, null, null} ; [ DW_TAG_subprogram ]
!14 = metadata !{i32 589845, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !15, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!15 = metadata !{null, metadata !12}
!16 = metadata !{i32 589870, i32 0, metadata !17, metadata !"get1", metadata !"get1", metadata !"_ZN8classDer4get1Ev", metadata !2, i32 11, metadata !24, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null} ; [ DW_TAG_subprogram ]
!17 = metadata !{i32 589826, metadata !0, metadata !"classDer", metadata !2, i32 8, i64 8, i64 8, i32 0, i32 0, null, metadata !18, i32 0, null, null} ; [ DW_TAG_class_type ]
!18 = metadata !{metadata !19, metadata !16, metadata !20}
!19 = metadata !{i32 589852, metadata !17, null, metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !7} ; [ DW_TAG_inheritance ]
!20 = metadata !{i32 589870, i32 0, metadata !17, metadata !"classDer", metadata !"classDer", metadata !"", metadata !2, i32 8, metadata !21, i1 false, i1 false, i32 0, i32 0, null, i32 320, i1 false, null, null} ; [ DW_TAG_subprogram ]
!21 = metadata !{i32 589845, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !22, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!22 = metadata !{null, metadata !23}
!23 = metadata !{i32 589839, metadata !0, metadata !"", i32 0, i32 0, i64 32, i64 32, i64 0, i32 64, metadata !17} ; [ DW_TAG_pointer_type ]
!24 = metadata !{i32 589845, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !25, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!25 = metadata !{metadata !5, metadata !23}
!26 = metadata !{i32 589870, i32 0, metadata !0, metadata !"get1", metadata !"get1", metadata !"_ZN8classDer4get1Ev", metadata !2, i32 11, metadata !24, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, i32 (%class.classDer*)* #_ZN8classDer4get1Ev, null, metadata !16} ; [ DW_TAG_subprogram ]
!27 = metadata !{i32 590080, metadata !28, metadata !"x", metadata !2, i32 17, metadata !17, i32 0} ; [ DW_TAG_auto_variable ]
!28 = metadata !{i32 589835, metadata !1, i32 16, i32 1, metadata !2, i32 0} ; [ DW_TAG_lexical_block ]
!29 = metadata !{i32 17, i32 14, metadata !28, null}
!30 = metadata !{i32 18, i32 5, metadata !28, null}
!31 = metadata !{i32 590081, metadata !26, metadata !"this", metadata !2, i32 16777227, metadata !23, i32 64} ; [ DW_TAG_arg_variable ]
!32 = metadata !{i32 11, i32 9, metadata !26, null}
!33 = metadata !{i32 11, i32 16, metadata !34, null}
!34 = metadata !{i32 589835, metadata !26, i32 11, i32 15, metadata !2, i32 1} ; [ DW_TAG_lexical_block ]
Looking for the class-type tags, you find
!7 = metadata !{i32 589826, metadata !0, metadata !"classBase", metadata !2, i32 2, i64 8, i64 8, i32 0, i32 0, null, metadata !8, i32 0, null, null} ; [ DW_TAG_class_type ]
!17 = metadata !{i32 589826, metadata !0, metadata !"classDer", metadata !2, i32 8, i64 8, i64 8, i32 0, i32 0, null, metadata !18, i32 0, null, null} ; [ DW_TAG_class_type ]
Related
I would like to achieve the following in an efficient way in numpy. Suppose I have a matrix
A = np.asarray([[1, 2], [3, 4]])
and
B = np.asarray([1, 10, 100])
I would like to multiply each element in A with the first element of B, then each element in A with the second element in B etc. At the end a matrix of shape (A.shape[0]*B.shape[0], A.shape[1])
the result should be
np.asarray([[1, 2], [3, 4], [10, 20], [30, 40], [100, 200], [300, 400]])
Out[216]:
array([[ 1, 2],
[ 3, 4],
[ 10, 20],
[ 30, 40],
[100, 200],
[300, 400]])
Reshape with numpy broadcasting:
# option 1
(A * B[:,None,None]).reshape(-1, A.shape[1])
#array([[ 1, 2],
# [ 3, 4],
# [ 10, 20],
# [ 30, 40],
# [100, 200],
# [300, 400]])
# option 2
(A.ravel() * B[:,None]).reshape(-1, A.shape[1])
#array([[ 1, 2],
# [ 3, 4],
# [ 10, 20],
# [ 30, 40],
# [100, 200],
# [300, 400]])
Or use np.einsum:
np.einsum('ij,k->kij', A, B).reshape(-1, A.shape[1])
#array([[ 1, 2],
# [ 3, 4],
# [ 10, 20],
# [ 30, 40],
# [100, 200],
# [300, 400]])
options: {"title":"Overall Stats","height":230,"legend":{"position":"in"},"hAxis":{"title":"Division"}},
I have this as my options for my google column chart but this displays "Division" on both my vertical and horizontal axis and removes all the labels on the hAxis. Can anyone tell me why this is happening?
is there more you can share?
seems to work fine here...
google.charts.load('current', {
callback: function () {
var data = new google.visualization.DataTable();
data.addColumn('timeofday', 'Time of Day');
data.addColumn('number', 'Motivation Level');
data.addColumn('number', 'Energy Level');
data.addRows([
[{v: [8, 0, 0], f: '8 am'}, 1, .25],
[{v: [9, 0, 0], f: '9 am'}, 2, .5],
[{v: [10, 0, 0], f:'10 am'}, 3, 1],
[{v: [11, 0, 0], f: '11 am'}, 4, 2.25],
[{v: [12, 0, 0], f: '12 pm'}, 5, 2.25],
[{v: [13, 0, 0], f: '1 pm'}, 6, 3],
[{v: [14, 0, 0], f: '2 pm'}, 7, 4],
[{v: [15, 0, 0], f: '3 pm'}, 8, 5.25],
[{v: [16, 0, 0], f: '4 pm'}, 9, 7.5],
[{v: [17, 0, 0], f: '5 pm'}, 10, 10],
]);
new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
containerId: 'chart_div',
dataTable: data,
options: {"title":"Overall Stats","height":230,"legend":{"position":"in"},"hAxis":{"title":"Division"}}
}).draw();
},
packages: ['corechart', 'controls']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
I am creating a Google line chart as per Google Line Chart Documentation.
I want to style the colour of the line such that it is a gradient between two colours, say between Green and Red. The weighting of each colour should be controlled by the 'y' value of the line.
i.e. at the point where the line's 'y' value is 0, the line will be completely green, At the highest 'y' value on the it should be completely red. In between values should have a weighting depending on the value of y at that point.
Is this possible? If so, how?
Since Google Line Chart is SVG based, you could customize how the line can change from one color to another via linearGradient element.
The below example shows how to inject [linearGradient element] into the chart (google.visualization.LineChart):
google.load('visualization', '1', { packages: ['corechart', 'line'] });
google.setOnLoadCallback(drawBackgroundColor);
function drawBackgroundColor() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Dogs');
data.addRows([
[0, 0], [1, 10], [2, 23], [3, 17], [4, 18], [5, 9],
[6, 11], [7, 27], [8, 33], [9, 40], [10, 32], [11, 35],
[12, 30], [13, 40], [14, 42], [15, 47], [16, 44], [17, 48],
[18, 52], [19, 54], [20, 42], [21, 55], [22, 56], [23, 57],
[24, 60], [25, 50], [26, 52], [27, 51], [28, 49], [29, 53],
[30, 55], [31, 60], [32, 61], [33, 59], [34, 62], [35, 65],
[36, 62], [37, 58], [38, 55], [39, 61], [40, 64], [41, 65],
[42, 63], [43, 66], [44, 67], [45, 69], [46, 69], [47, 70],
[48, 72], [49, 68], [50, 66], [51, 65], [52, 67], [53, 70],
[54, 71], [55, 72], [56, 73], [57, 75], [58, 70], [59, 68],
[60, 64], [61, 60], [62, 65], [63, 60], [64, 50], [65, 45],
[66, 40], [67, 42], [68, 35], [69, 30]
]);
var options = {
hAxis: {
title: 'Time'
},
vAxis: {
title: 'Popularity'
},
backgroundColor: '#f1f8e9'
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
google.visualization.events.addOneTimeListener(chart, 'ready', function () {
addChartGradient(chart);
});
chart.draw(data, options);
}
function addChartGradient(chart) {
var chartDiv = chart.getContainer();
var svg = chartDiv.getElementsByTagName('svg')[0];
var properties = {
id: "chartGradient",
x1: "0%",
y1: "0%",
x2: "0%",
y2: "100%",
stops: [
{ offset: '5%', 'stop-color': '#f60' },
{ offset: '95%', 'stop-color': '#ff6' }
]
};
createGradient(svg, properties);
var chartPath = svg.getElementsByTagName('path')[1]; //0 path corresponds to legend path
chartPath.setAttribute('stroke', 'url(#chartGradient)');
}
function createGradient(svg, properties) {
var svgNS = svg.namespaceURI;
var grad = document.createElementNS(svgNS, 'linearGradient');
grad.setAttribute('id', properties.id);
["x1","y1","x2","y2"].forEach(function(name) {
if (properties.hasOwnProperty(name)) {
grad.setAttribute(name, properties[name]);
}
});
for (var i = 0; i < properties.stops.length; i++) {
var attrs = properties.stops[i];
var stop = document.createElementNS(svgNS, 'stop');
for (var attr in attrs) {
if (attrs.hasOwnProperty(attr)) stop.setAttribute(attr, attrs[attr]);
}
grad.appendChild(stop);
}
var defs = svg.querySelector('defs') ||
svg.insertBefore(document.createElementNS(svgNS, 'defs'), svg.firstChild);
return defs.appendChild(grad);
}
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<div id="chart_div"></div>
JSFiddle
I have a stacked bar chart with annotations which sums the values. The annotations are always at the end of the bar, but when there isn't a value for the last data row (I) the annotation is at the beginning and I don't know how to fix it.
var dataArray = [
["Date", "A", "B", "C", "D", "E", "F", "G", "H", "I", {role: 'annotation'}],
["7.08.2015", 0, 0, 0, 3, 6, 1, 0, 0, 0, 10],
["6.08.2015", 0, 0, 0, 0, 4, 6, 1, 0, 7, 18],
["5.08.2015", 0, 0, 0, 2, 4, 0, 0, 0, 5, 11]
];
Demo and code at JSFiddle
Found a workaround ... added a new data column, with the name Total, is has the same value as the annotation:
var dataArray = [
["Date", "A", "B", "C", "D", "E", "F", "G", "H", "I", "Total", {role: 'annotation'}],
["7.08.2015", 0, 0, 0, 3, 6, 1, 0, 0, 0, 10, 10],
["6.08.2015", 0, 0, 0, 0, 4, 6, 1, 0, 7, 18, 18],
["5.08.2015", 0, 0, 0, 2, 4, 0, 0, 0, 5, 11, 11]
];
And added this to the options:
var options = {
...
series: {
9: {
color: 'transparent',
type: "bar",
targetAxisIndex: 1,
visibleInLegend: false
}
}
};
Demo and code at JSFiddle
This makes the Total bar transparent, hide it in the legends and let it start from the zero point.
Dynamic version which takes the last data row for the annotations:
var series = {};
series[data.getNumberOfColumns() - 3] = {
color: 'transparent',
type: "bar",
targetAxisIndex: 1,
visibleInLegend: false
};
options["series"] = series;
Demo and code at JSFiddle
I have llvm-IR function
When i try it convert to .bc, llvm-as has showed a lot of error.
For example:
Instruction does not dominate all uses!
%rightBoundary.1.i = phi i32 [ %dec.i, %while.cond1.i ], [ %rightBoundary.046.i, %while.cond1.preheader.i ]
%rightBoundary.046.i = phi i32 [ %rightBoundary.1.i, %while.end17.i ], [ %endIndex, %bNew_block ]
What i do wrong in llvm-ir code? I would like insert few "opaque predicate" in llvm-ir code.
; Function Attrs: nounwind uwtable
define void #_Z9ArraySortPiii(i32* %array, i32 %startIndex, i32 %endIndex) #3 {
entry:
%cmp18 = icmp sgt i32 %endIndex, %startIndex
br i1 %cmp18, label %while.cond1.preheader.i.preheader, label %if.end
while.cond1.preheader.i.preheader: ; preds = %_Z10SplitArrayPiiii.exit, %entry
%idxprom16.pn.in = phi i32 [ %inc.i, %_Z10SplitArrayPiiii.exit ], [ %startIndex, %entry ]
%0 = alloca i32
store i32 12222, i32* %0
%1 = load i32* %0
%predicate_cmp = icmp eq i32 0, %1
br i1 %predicate_cmp, label %bNew_block, label %while.end.i
bNew_block: ; preds = %while.cond1.preheader.i.preheader
%idxprom16.pn = sext i32 %idxprom16.pn.in to i64
%.in = getelementptr inbounds i32* %array, i64 %idxprom16.pn
%2 = load i32* %.in, align 4
br label %while.cond1.preheader.i
while.cond1.preheader.i: ; preds = %while.end17.i, %bNew_block
%rightBoundary.046.i = phi i32 [ %rightBoundary.1.i, %while.end17.i ], [ %endIndex, %bNew_block ]
%leftBoundary.045.i = phi i32 [ %leftBoundary.1.i, %while.end17.i ], [ %idxprom16.pn.in, %bNew_block ]
%3 = sext i32 %rightBoundary.046.i to i64
br label %while.cond1.i
while.cond1.i: ; preds = %while.cond1.i, %while.cond1.preheader.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond1.i ], [ %3, %while.cond1.preheader.i ]
%rightBoundary.1.i = phi i32 [ %dec.i, %while.cond1.i ], [ %rightBoundary.046.i, %while.cond1.preheader.i ]
%arrayidx.i = getelementptr inbounds i32* %array, i64 %indvars.iv.i
%4 = load i32* %arrayidx.i, align 4, !tbaa !0
%5 = trunc i64 %indvars.iv.i to i32
%cmp2.i = icmp sgt i32 %4, %2
%cmp3.i = icmp sgt i32 %5, %leftBoundary.045.i
%or.cond.i = and i1 %cmp2.i, %cmp3.i
%indvars.iv.next.i = add i64 %indvars.iv.i, -1
%dec.i = add nsw i32 %rightBoundary.1.i, -1
br i1 %or.cond.i, label %while.cond1.i, label %while.end.i
while.end.i: ; preds = %while.cond1.preheader.i.preheader, %while.cond1.i
%idxprom5.i = sext i32 %leftBoundary.045.i to i64
%arrayidx6.i = getelementptr inbounds i32* %array, i64 %idxprom5.i
%6 = load i32* %arrayidx6.i, align 4, !tbaa !0
store i32 %4, i32* %arrayidx6.i, align 4, !tbaa !0
store i32 %6, i32* %arrayidx.i, align 4, !tbaa !0
br label %while.cond9.i
while.cond9.i: ; preds = %while.cond9.i, %while.end.i
%indvars.iv48.i = phi i64 [ %indvars.iv.next49.i, %while.cond9.i ], [ %idxprom5.i, %while.end.i ]
%leftBoundary.1.i = phi i32 [ %inc.i, %while.cond9.i ], [ %leftBoundary.045.i, %while.end.i ]
%arrayidx11.i = getelementptr inbounds i32* %array, i64 %indvars.iv48.i
%7 = load i32* %arrayidx11.i, align 4, !tbaa !0
%8 = trunc i64 %indvars.iv48.i to i32
%cmp12.i = icmp sle i32 %7, %2
%cmp14.i = icmp slt i32 %8, %rightBoundary.1.i
%inc.i = add nsw i32 %leftBoundary.1.i, 1
%indvars.iv.next49.i = add i64 %indvars.iv48.i, 1
%or.cond42.i = and i1 %cmp12.i, %cmp14.i
br i1 %or.cond42.i, label %while.cond9.i, label %while.end17.i
while.end17.i: ; preds = %while.cond9.i
store i32 %6, i32* %arrayidx11.i, align 4, !tbaa !0
store i32 %7, i32* %arrayidx.i, align 4, !tbaa !0
%cmp.i = icmp slt i32 %leftBoundary.1.i, %rightBoundary.1.i
br i1 %cmp.i, label %while.cond1.preheader.i, label %_Z10SplitArrayPiiii.exit
_Z10SplitArrayPiiii.exit: ; preds = %while.end17.i
%idxprom1 = sext i32 %leftBoundary.1.i to i64
%arrayidx2 = getelementptr inbounds i32* %array, i64 %idxprom1
store i32 %2, i32* %arrayidx2, align 4, !tbaa !0
%sub = add nsw i32 %leftBoundary.1.i, -1
tail call void #_Z9ArraySortPiii(i32* %array, i32 %idxprom16.pn.in, i32 %sub)
%cmp = icmp slt i32 %inc.i, %endIndex
br i1 %cmp, label %while.cond1.preheader.i.preheader, label %if.end
if.end: ; preds = %_Z10SplitArrayPiiii.exit, %entry
ret void
}
Instruction does not dominate all uses!
%rightBoundary.1.i = phi i32 [ %dec.i, %while.cond1.i ], [ %rightBoundary.046.i, %while.cond1.preheader.i ]
%rightBoundary.046.i = phi i32 [ %rightBoundary.1.i, %while.end17.i ], [ %endIndex, %bNew_block ]
Instruction does not dominate all uses!
%2 = load i32* %.in, align 4
%cmp2.i = icmp sgt i32 %4, %2
Instruction does not dominate all uses!
%leftBoundary.045.i = phi i32 [ %leftBoundary.1.i, %while.end17.i ], [ %idxprom16.pn.in, %bNew_block ]
%idxprom5.i = sext i32 %leftBoundary.045.i to i64
Instruction does not dominate all uses!
%4 = load i32* %arrayidx.i, align 4, !tbaa !0
store i32 %4, i32* %arrayidx6.i, align 4, !tbaa !0
Instruction does not dominate all uses!
%arrayidx.i = getelementptr inbounds i32* %array, i64 %indvars.iv.i
store i32 %6, i32* %arrayidx.i, align 4, !tbaa !0
Instruction does not dominate all uses!
%leftBoundary.045.i = phi i32 [ %leftBoundary.1.i, %while.end17.i ], [ %idxprom16.pn.in, %bNew_block ]
%leftBoundary.1.i = phi i32 [ %inc.i, %while.cond9.i ], [ %leftBoundary.045.i, %while.end.i ]
Instruction does not dominate all uses!
%2 = load i32* %.in, align 4
%cmp12.i = icmp sle i32 %7, %2
Instruction does not dominate all uses!
%rightBoundary.1.i = phi i32 [ %dec.i, %while.cond1.i ], [ %rightBoundary.046.i, %while.cond1.preheader.i ]
%cmp14.i = icmp slt i32 %8, %rightBoundary.1.i
Instruction does not dominate all uses!
%arrayidx.i = getelementptr inbounds i32* %array, i64 %indvars.iv.i
store i32 %7, i32* %arrayidx.i, align 4, !tbaa !0
Instruction does not dominate all uses!
%rightBoundary.1.i = phi i32 [ %dec.i, %while.cond1.i ], [ %rightBoundary.046.i, %while.cond1.preheader.i ]
%cmp.i = icmp slt i32 %leftBoundary.1.i, %rightBoundary.1.i
Instruction does not dominate all uses!
%2 = load i32* %.in, align 4
store i32 %2, i32* %arrayidx2, align 4, !tbaa !0
Instruction does not dominate all uses means you're using a register from a block that may not have been executed.
It looks like in this case you're using the register assigned to by the phi instruction in some block that could be reached without executing the phi instruction