1. turn off the local static array bounds csheking pass.
2. progbb, not makes baggy bounds with capsaicin(BB) and baggy bounds
without capsaicin(BB1)
llvm-svn: 127955
diff --git a/safecode/lib/InsertPoolChecks/GEPChecks.cpp b/safecode/lib/InsertPoolChecks/GEPChecks.cpp
index 3fbcaf6..9515428 100644
--- a/safecode/lib/InsertPoolChecks/GEPChecks.cpp
+++ b/safecode/lib/InsertPoolChecks/GEPChecks.cpp
@@ -35,6 +35,9 @@
cl::opt<bool> DisableStructChecks ("disable-structgepchecks", cl::Hidden,
cl::init(false),
cl::desc("Disable Struct GEP Checks"));
+cl::opt<bool> DisableCapsaicin ("disable-cap", cl::Hidden,
+ cl::init(false),
+ cl::desc("Disable Struct GEP Checks"));
// Pass Statistics
namespace {
@@ -54,14 +57,19 @@
//
// Determine if the GEP is safe. If it is, then don't do anything.
//
- if (abcPass->isGEPSafe(&GEP)) {
- ++SafeGEP;
- return;
- }
+ if(!DisableCapsaicin)
if (smtPass->checkGEPSafe(&GEP)) {
+ errs() << "Safe1 " ;
+ GEP.dump();
++SafeGEP;
return;
}
+ /*if (abcPass->isGEPSafe(&GEP)) {
+ errs() << "Safe2 " ;
+ GEP.dump();
+ ++SafeGEP;
+ return;
+ }*/
//
// If this only indexes into a structure, ignore it.
diff --git a/safecode/test/TEST.bb.Makefile b/safecode/test/TEST.bb.Makefile
index ffee3f6..683d3a0 100755
--- a/safecode/test/TEST.bb.Makefile
+++ b/safecode/test/TEST.bb.Makefile
@@ -130,6 +130,13 @@
-$(LLVMLD) $(LLVMLDFLAGS) -o $@.bb.ld $@.bb $(BB_RT_BC) 2>&1 > $@.out
-$(LOPT) $(OPTZN_PASSES) $@.bb.ld.bc -o $@ -f 2>&1 >> $@.out
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.bc): \
+Output/%.bb1.bc: Output/%.presc.bc $(LOPT) $(BB_RT_BC)
+ -@rm -f $(CURDIR)/$@.info
+ -$(SC_STATS) $(SCOPTS) $(SCOPTS2) -runtime=RUNTIME_BB -disable-cap $< -f -o $@.bb1 2>&1 > $@.out
+ -$(LLVMLD) $(LLVMLDFLAGS) -o $@.bb1.ld $@.bb1 $(BB_RT_BC) 2>&1 > $@.out
+ -$(LOPT) $(OPTZN_PASSES) $@.bb1.ld.bc -o $@ -f 2>&1 >> $@.out
+
#
# These rules compile the new .bc file into a .c file using llc
#
@@ -141,6 +148,10 @@
Output/%.bb.s: Output/%.bb.bc $(LLC)
-$(LLC) $(LLCFLAGS) -f $< -o $@
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.s): \
+Output/%.bb1.s: Output/%.bb1.bc $(LLC)
+ -$(LLC) $(LLCFLAGS) -f $< -o $@
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB.s): \
Output/%.noOOB.s: Output/%.noOOB.bc $(LLC)
-$(LLC) $(LLCFLAGS) -f $< -o $@
@@ -153,6 +164,10 @@
Output/%.bb.cbe.c: Output/%.bb.bc $(LLC)
-$(LLC) -march=c $(LLCFLAGS) -f $< -o $@
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.cbe.c): \
+Output/%.bb1.cbe.c: Output/%.bb1.bc $(LLC)
+ -$(LLC) -march=c $(LLCFLAGS) -f $< -o $@
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB.cbe.c): \
Output/%.noOOB.cbe.c: Output/%.noOOB.bc $(LLC)
-$(LLC) -march=c $(LLCFLAGS) -f $< -o $@
@@ -169,6 +184,10 @@
Output/%.bb: Output/%.bb.cbe.c $(BB_RT_O)
-$(LLVMGCC) $(CBECFLAGS) $(CFLAGS) $< $(LLCLIBS) $(BB_RT_O) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
+$(PROGRAMS_TO_TEST:%=Output/%.bb1): \
+Output/%.bb1: Output/%.bb1.cbe.c $(BB_RT_O)
+ -$(LLVMGCC) $(CBECFLAGS) $(CFLAGS) $< $(LLCLIBS) $(BB_RT_O) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB): \
Output/%.noOOB: Output/%.noOOB.cbe.c
-$(LLVMGCC) $(CBECFLAGS) $(CFLAGS) $< $(LLCLIBS) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
@@ -181,6 +200,10 @@
Output/%.bb: Output/%.bb.s $(BB_RT_O)
-$(LLVMGCC) $(CFLAGS) $< $(LLCLIBS) $(BB_RT_O) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
+$(PROGRAMS_TO_TEST:%=Output/%.bb1): \
+Output/%.bb1: Output/%.bb1.s $(BB_RT_O)
+ -$(LLVMGCC) $(CFLAGS) $< $(LLCLIBS) $(BB_RT_O) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB): \
Output/%.noOOB: Output/%.noOOB.s
-$(LLVMGCC) $(CFLAGS) $< $(LLCLIBS) $(PA_RT_O) $(LDFLAGS) -o $@ $(STATICFLAGS) -lstdc++
@@ -204,6 +227,10 @@
Output/%.bb.out-llc: Output/%.bb
-$(RUNSAFELY) $(STDIN_FILENAME) $@ $(WATCHDOG) $< $(RUN_OPTIONS)
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.out-llc): \
+Output/%.bb1.out-llc: Output/%.bb1
+ -$(RUNSAFELY) $(STDIN_FILENAME) $@ $(WATCHDOG) $< $(RUN_OPTIONS)
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB.out-llc): \
Output/%.noOOB.out-llc: Output/%.noOOB
-$(RUNSAFELY) $(STDIN_FILENAME) $@ $(WATCHDOG) $< $(RUN_OPTIONS)
@@ -230,6 +257,14 @@
-(cd Output/bbcbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
-cp Output/bbcbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.out-llc): \
+Output/%.bb1.out-llc: Output/%.bb1
+ -$(SPEC_SANDBOX) bb1cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ $(WATCHDOG) ../../$< $(RUN_OPTIONS)
+ -(cd Output/bb1cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ -cp Output/bb1cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB.out-llc): \
Output/%.noOOB.out-llc: Output/%.noOOB
-$(SPEC_SANDBOX) noOOBcbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
@@ -253,6 +288,11 @@
@cp Output/$*.out-nat Output/$*.bb.out-nat
-$(DIFFPROG) llc $*.bb $(HIDEDIFF)
+$(PROGRAMS_TO_TEST:%=Output/%.bb1.diff-llc): \
+Output/%.bb1.diff-llc: Output/%.out-nat Output/%.bb1.out-llc
+ @cp Output/$*.out-nat Output/$*.bb1.out-nat
+ -$(DIFFPROG) llc $*.bb1 $(HIDEDIFF)
+
$(PROGRAMS_TO_TEST:%=Output/%.noOOB.diff-llc): \
Output/%.noOOB.diff-llc: Output/%.out-nat Output/%.noOOB.out-llc
@cp Output/$*.out-nat Output/$*.noOOB.out-nat
@@ -262,10 +302,9 @@
# This rule wraps everything together to build the actual output the report is
# generated from.
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
-Output/%.$(TEST).report.txt: Output/%.out-nat \
- Output/%.noOOB.diff-llc \
- Output/%.safecode.diff-llc \
- Output/%.bb.diff-llc \
+Output/%.$(TEST).report.txt: Output/%.out-nat \
+ Output/%.bb.diff-llc \
+ Output/%.bb1.diff-llc \
Output/%.LOC.txt
@echo > $@
@echo ">>> ========= " \'$*\' Program >> $@
@@ -285,6 +324,10 @@
printf "CBE-RUN-TIME-BB: " >> $@;\
grep "^user" Output/$*.bb.out-llc.time >> $@;\
fi
+ @-if test -f Output/$*.bb1.diff-llc; then \
+ printf "CBE-RUN-TIME-BB1: " >> $@;\
+ grep "^user" Output/$*.bb1.out-llc.time >> $@;\
+ fi
printf "LOC: " >> $@
cat Output/$*.LOC.txt >> $@
#@cat Output/$*.$(TEST).bc.info >> $@
diff --git a/safecode/test/TEST.bb.report b/safecode/test/TEST.bb.report
index 84daa95..88acb7b 100755
--- a/safecode/test/TEST.bb.report
+++ b/safecode/test/TEST.bb.report
@@ -51,6 +51,8 @@
["SC + Multi-PA", 'CBE-RUN-TIME-SAFECODE: user\s*([.0-9m:]+)', \&FormatTime],
[],
["SC + BB", 'CBE-RUN-TIME-BB: user\s*([.0-9m:]+)', \&FormatTime],
+ [],
+ ["SC + BB1", 'CBE-RUN-TIME-BB1: user\s*([.0-9m:]+)', \&FormatTime],
# ["NumPools", '([0-9]+).*Number of pools allocated'],
# ["Typesafe", '([0-9]+).*Number of typesafe pools'],
# ["BumpPtr", '([0-9]+).*Number of bump pointer pools'],