mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
Add a NullFolder class that doesn't fold constants.
This may be used as the second IRBuilder template parameter, the idea being that people learning LLVM may find it helpful (several people asked on IRC if it was possible to turn off constant folding because it made it hard for them to see what was going on). Compiles, but otherwise completely untested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54698 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -493,14 +493,14 @@ public:
|
||||
const char *Name = "") {
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateCompare(P, LC, RC);
|
||||
return Folder.CreateICmp(P, LC, RC);
|
||||
return Insert(new ICmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
|
||||
const char *Name = "") {
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateCompare(P, LC, RC);
|
||||
return Folder.CreateFCmp(P, LC, RC);
|
||||
return Insert(new FCmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
|
||||
@ -508,14 +508,14 @@ public:
|
||||
const char *Name = "") {
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateCompare(P, LC, RC);
|
||||
return Folder.CreateVICmp(P, LC, RC);
|
||||
return Insert(new VICmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
Value *CreateVFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
|
||||
const char *Name = "") {
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateCompare(P, LC, RC);
|
||||
return Folder.CreateVFCmp(P, LC, RC);
|
||||
return Insert(new VFCmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user