Index: src/IceClFlags.cpp |
diff --git a/src/IceClFlags.cpp b/src/IceClFlags.cpp |
index a433b9a7ee836a5d2f06075634e139a79909fc90..cd5ee402911d55597a2f3990f9322e0a17d2f4c2 100644 |
--- a/src/IceClFlags.cpp |
+++ b/src/IceClFlags.cpp |
@@ -106,7 +106,8 @@ cl::opt<bool> |
// therefore the tests would need to be changed. |
cl::opt<unsigned long long> |
RandomSeed("sz-seed", cl::desc("Seed the random number generator"), |
- cl::init(time(0))); |
+ // cl::init(time(0))); |
+ cl::init(1)); |
cl::opt<bool> ShouldDoNopInsertion("nop-insertion", |
cl::desc("Randomly insert NOPs"), |
@@ -251,6 +252,21 @@ cl::opt<std::string> OutputFilename("o", cl::desc("Override output filename"), |
Ice::IceString AppName; |
+// Define the command line options for immediates pooling and randomization |
+cl::opt<Ice::RandomizeAndPoolImmediatesEnum> RandomizeAndPoolImmediatesOption( |
+ "randomize-pool-immediates", |
+ cl::desc("Randomize or pooling the representation of immediates"), |
+ cl::init(Ice::RPI_None), |
+ // cl::init(Ice::RPI_Randomize), |
Jim Stichnoth
2015/06/19 16:51:02
remove commented lines
qining
2015/06/19 20:22:25
Done.
|
+ // cl::init(Ice::RPI_Pool), |
+ cl::values(clEnumValN(Ice::RPI_None, "none", |
+ "Do not randomize or pooling immediates (default)"), |
+ clEnumValN(Ice::RPI_Randomize, "randomize", |
+ "Turn on immediate constants blinding"), |
+ clEnumValN(Ice::RPI_Pool, "pool", |
+ "Turn on immediate constants pooling"), |
+ clEnumValEnd)); |
+ |
} // end of anonymous namespace |
namespace Ice { |
@@ -343,6 +359,10 @@ void ClFlags::getParsedClFlags(ClFlags &OutFlags) { |
OutFlags.setMaxNopsPerInstruction(::MaxNopsPerInstruction); |
OutFlags.setNopProbabilityAsPercentage(::NopProbabilityAsPercentage); |
OutFlags.setVerbose(VMask); |
+ |
+ // set for immediates randomization or pooling option |
+ OutFlags.setRandomizeAndPoolImmediatesOption( |
+ ::RandomizeAndPoolImmediatesOption); |
} |
void ClFlags::getParsedClFlagsExtra(ClFlagsExtra &OutFlagsExtra) { |